Rsync after migration?

I’m setting up a new MIAB v63 to migrate an old server onto. I’m restoring files from a duplicity backup, but this is going to take a long time, and will be somewhat outdated by the time it’s finished. The old and new servers are up and running at the same time, and all the latest data is still on the old (live) server. After completing a restore on the new server, can I sync what’s changed since the backup by rsyncing from the old server to the new? Along the lines of:

rsync -avz --delete old.example.com:/home/user-data/ /home/user-data/

I know that there are some config files in that directory created during the new installation that this would overwrite (though the duplicity restore does this anyway), but the server is going to have the same name as the original, and I want everything to act identically. Should I keep the config files on the new box?

Is this feasible?

2 Likes

There’s no need to keep anything in /home/user-data when restoring from another box. Your rsync command should be OK. That’s probably the right way to complete a live restore.

2 Likes

Great stuff, thank you.

My only thought would be why not limit the rsync to the maildirs?

Just in case anybody else decides to be clever like me: Don’t read this and think Cool, I’ll do a live migration too and then just do a final backup/restore with Duplicity instead of setting up rsync!, because Duplicity won’t overwrite files that already exist in your target system and you’ll have to wipe ~user-data down and do the full restore again.