Is it possible? Most things are possible. However, as someone who's worked with computers since the 1980's I would say it's NOT advisable. If you get in the habit of simply moving the old drive with your data on it to a new system, what will you do when the old drive fails, rendering all your hard work inaccessible? It takes far less time and expense to duplicate existing data from a healthy drive than to recover data from an unhealthy one. What you SHOULD do is backup your data and restore it to the new system. In most cases, virtually all the data that's important to you will be found in /home/[your user name]/ and if it turns out you are missing something you will still have it on the old computer AND the backup and can easily rectify the problem. If you move the drive this will not be the case. rsync
is a great tool for backing up and restoring data and is available in every linux distribution I've seen in the past several decades.
- Determine how much space you need for your backup:
du -ch /home
- Obtain sufficient space for your backup:
This could be as simple as an external drive, or stick, or somewhere in the cloud if you don't mind entrusting your data to someone you don't know.
2a) Most commercially available external drives nowadays come preformatted with NTFS or FAT which have some limitations when it comes to maintaining file attributes. If you wish to maintain all the permissions you'll want to format the drive yourself with a Linux filesystem. I prefer ext4.
- Mount your backup target. In any currently supported version of Ubuntu this is usually as simple as plugging in the external device. I you intend to backup to the cloud, consult with your provider to determine how to mount the space.
- Backup your data. See
man rsync
For my purposes it would be something like this:
sudo rsync -aruv /home /media/me/TOSHIBA\ EXT/Backup-rsync/
- Restore your data. See
man rsync
For my purposes it would be something like this:
sudo rsync -aruv /media/me/TOSHIBA\ EXT/Backup-rsync/home /home
- confirm your results
Another benefit of this approach is that you now have a backup that you can easily and rapidly keep up to date. rsync with the -u switch allows rsync to skip files that are still new (unchanged) in the destination directory speeding up the process by a large factor on subsequent runs. A well crafted rsync command can also delete files on the target that have been deleted from the source.