Single Dataset Migration
This guide will help you migrate from multiple media datasets to one single dataset. Following this single dataset structure will ensure smooth navigation and better performance.
Preparing New Dataset¶
Please See Dataset for a recommended structure of the new dataset.
Note: The name can be change later.
Moving Files to new dataset¶
1.) Open up a
tmux session so if your shell times out or you want to leave it to run it will continue in your absence.
To start the
tmux session all you need to do is run
2.) To move the data to the new data we just created we are going to be using the
rsync command to move all files to the new dataset with their structure intact.
ALWAYS DO A DRYRUN BEFORE YOU PROCEED WITH THE LIVE RUN by adding
--dry-runarguements to rsync
Replace /mnt/old/dataset/ and /mnt/new/dataset/folder with your datasets.
Dry Run Examples:
rsync -aHn /mnt/old/dataset/ /mnt/new/dataset rsync -aH --dryrun /mnt/old/dataset/ /mnt/new/dataset
| lessto the end to make to a bit easier if transfer a lot of files to make sure the structure stays how you want it with all files.
Once everything looks good remove
--dry-run from the command. We are then going to add
-aHretains permissions, and hardlinks while moving files recursively
--progressShows the user the progress as
--remove-source-fileswill remove all files as they are transfered excluding folders.
rsync -aH --progress --remove-source-files /mnt/old/dataset/ /mnt/new/dataset/folder
If you get timed out during the move it's okay. In shell type
tmux ato resume the session.
1.) Once all data has been moved, you are free to exit
exit. You are now free to delete all remnants of the old dataset.
2.) To rename the new media dataset in shell run:
zfs rename /old/dataset /new/dataset