braindump of things to do/directories not to copy when cloning physical debian to a vm using rsync
warning – below is very much server dependent; stop all the ‘moving parts’ – in my case – cron jobs, mysql server.
- prepare destination system – do proper partitioning, install the base system
- assign temporary address to the new server so old and new one can talk one to another
-
run on both machines:
apt-get install rsync /etc/init.d/cron stop; /etc/init.d/mysql stop # very much server-role dependent
- run on the old one:
cd / rsync --exclude dev/ --exclude proc/ --exclude lib/modules --exclude sys/ --exclude etc/fstab --exclude etc/udev --exclude boot/ --exclude etc/mtab --exclude etc/lvm/ --include ".*" -Rav --delete -e "ssh -c arcfour " ./ root@newServer:/
Thanks for this post! I was thinking about how to get a total rpegross for rsync for quite a while, and this finally encouraged me to just do it. Until rsync includes some total rpegross functionality, this is quite nice. I wanted to also get the original rsync output in the Terminal, so I made a slightly different version, and used Perl rather than awk, because I know it better. In case someone finds it useful, here is the version I’m using.