Migrating home (rsync?)

I am replacing Fedora with Ubuntu on my laptop. I need to backup my /home (approx 900 Gb) before doing this. I have a server at home (running Ubuntu 24.04 LTS) that has sufficient space, I access it via ssh. I can of course install everything on it.

I have a regular backup using borgbackup, but that excludes a lot of stuff that can be regenerated/downloaded, and I would prefer a “clone-like” backup where I make a copy overnight, reinstall Ubuntu, copy the home folder back the same way, and everything just works.

I also want the backup to be robust to interruptions. Stuff happens and I want to be able to restart copying.

Based on past experience I would use

rsync -aXSz -e ssh /home/tamas/ myserver:/path/on/server

but I thought I would check before starting the process.

In a particular,

  1. is there a method that is preferred these days over rsync? (and is FOSS, available in Ubuntu)

  2. is there anything I should exclude? eg in the past I would have excluded ~/.gvfs as it errors, but I no longer have that. I can exclude ~/.cache but it is insignificant (few Gb), and again, I want to start where I left off, incl flatpaks I have in my home directory, steam games I downloaded, etc.

  3. does -z make sense on a local network over wifi? I think that bandwidth is the bottleneck, but I am not sure how I would benchmark this.

rsync will work fine for this and it is fast.

If you are running this command from the source machine, then you are pushing to a remote machine. The structure of your command would not work if you are running it from the backup server, but I imagine you already know that.

From manpage…
Push: 
rsync [OPTION...] SRC... [USER@]HOST:DEST

You should not need ‘-e ssh’ since ssh is used by default in rsync.

You could add -v to see the output, recommend it. Also -n (dry-run) is wise on your first test run to be sure the operation is successful and to see that the data is going exactly where you wanted it to.

It’s not always required to rsync with sudo, although I usually do on remote copies. When copying system files you almost always need sudo. For /home probably not.

I am not familiar with Fedora, 0%. Regarding your end goal, I cannot speak to whether your Fedora /home will plug into /home on Ubuntu without any modifications. Others may know…

2 Likes

@aljames has made a very valid point.

I would doubt that .config files and .local/share files for every application are located identically for both Fedora and Ubuntu.

I think that you would be better off just copying data files (music, documents etc.).
Then (rhythmbox for example), you can double check if the Fedora configuration is usable in Ubuntu?

1 Like

For moving that much data, you must be aware of the “slow copy” or “low data transfer rate” problem (search askubuntu). Basically, since writes are slower than reads, system buffers fill up, memory gets fragmented, and things drag to a crawl (move mouse, 30 sec later the cursor moves 2"). There are numerous suggestions to help the problem, but many are tweaking system params that might be better left alone (scheduler, vm-dirty-bytes/rations,…).

Looking to the copy program, there might be ways to let the system recover memory. nocache before the copy command will at least prevent caching the input and save the buffers for output. rsync has an option, --bwlimit that looks interesting in giving the read side pause every now and then. I found that giving tar a --recordsize=500M will also allow the defrags to occur (watch /proc/buddyinfo to see the fragmentation situation and how it changes). There might be other processes grabbing cache space (virt-manager has a daemon that caches .img files! Use cachestats to see how much buffering your .img files take. I didn’t bother to kill the virt-manger daemon on a 300GB copy to USB/SSD, and found my data rate was 200MB+/sec for the transfer.

1 Like

This topic was automatically closed after 38 days. New replies are no longer allowed.