centosでサーバ環境丸ごと移行する場合

VPSなどで利用しました。

rsync -rtlzvogpHAX --exclude /boot/ --exclude /dev/ --exclude /proc/ --exclude /sys/ --exclude /var/run/ --exclude /var/lock/ --exclude ifcfg* --exclude ssh_host_* --exclude fstab --block-size=4096 -e ssh / ***.***.***.***:/

参考サイトをベースにrsync部分がそのままだと動かなかったので、rsync部分は上記を利用。

    • exclude /boot/をつけています。

その後、reinstallする
これは丸々コピーするとapacheなどが立ち上がらない為の対応。

yum upgrade --enablerepo=remi,epel,rpmforg
yum reinstall --enablerepo=remi,epel,rpmforge httpd mysql proftpd postfix

http://tanaka.sakura.ad.jp/2011/03/sakura-vps-upgrade.html