Moving data from one dataset to another within TrueNAS can be accomplished through a few methods, as the TrueNAS GUI does not provide a direct “move” function for data within datasets.
1. Using the Command Line Interface (CLI) via SSH:
This method offers the most direct control and is often the fastest for large amounts of data.
cd to navigate to the parent directory of your datasets.cp command to copy files and directories from the source dataset to the destination dataset. For example, to copy all contents from pool/old_dataset to pool/new_dataset:Code
cp -r /mnt/pool/old_dataset/* /mnt/pool/new_dataset/
The -r flag ensures recursive copying of directories and their contents.
rm -rf. Be extremely cautious with this command, as it permanently deletes data.2. Using ZFS Commands (for entire datasets or snapshots):
zfs rename: If you want to rename an entire dataset or move it to a different location within the same pool hierarchy (e.g., making it a child of another dataset), you can use zfs rename.Code
zfs rename pool/old_dataset pool/new_parent_dataset/new_dataset_name
zfs send and zfs receive: For replicating or moving entire datasets, including snapshots, you can use zfs send and zfs receive. This is particularly useful for moving datasets between pools or even different TrueNAS systems.Code
zfs send pool/old_dataset@snapshot_name | zfs receive destination_pool/new_dataset_name