快速搬服务器的笔记
serverA to serverB
login to serverA
1 rsync dirs
rsync -av /home/* root@serverB:/home/
2 rsync php & nginx
rsync -av /usr/local/lib/php serverB:/usr/local/lib/
rsync -av /usr/local/php serverB:/usr/local/
rsync -av /usr/local/sbin/php-fpm serverB:/usr/local/sbin/php-fpm
rsync -av /usr/local/etc/php-fpm.conf serverB:/usr/local/etc/php-fpm.conf
rsync -av /etc/init.d/php-fpm serverB:/etc/init.d/php-fpm
rsync -av /usr/local/var serverB:/usr/local/
rsync -av /usr/local/webserver serverB:/usr/local/
3 backu mysql
/usr/bin/innobackupex --user=root --password='pw' /$dir --no-timestamp
/usr/bin/innobackupex --user=root --password='pw' --apply-log /$dir
login to serverB
4 yum libs
yum install make libjpeg-devel.x86_64 libpng-devel.x86_64 pcre-devel.x86_64 libxml2-devel.x86_64 openssl-devel.x86_64 curl-devel.x86_64 gd.x86_64 libXpm-devel.x86_64 gd-devel.x86_64 curl-devel.x86_64 libidn.x86_64 libidn-devel.x86_64 autoconf.noarch gcc.x86_64 vim-enhanced.x86_64 screen.x86_64 ntp.x86_64 libxml2-devel.x86_64 openssl-devel.x86_64 curl-devel.x86_64 libmcrypt-devel.x86_64 mhash-devel.x86_64 libevent-devel.x86_64 libcurl-devel.x86_64 git gcc-c++ pcre-dev pcre-devel zlib-devel make tcl-devel.x86_64
5 yum percona
yum install Percona-Server-client-55 Percona-Server-server-55 percona-xtrabackup
6 copy back mysql
innobackupex --copy-back /$dbdir
7 link mysql.sock
ln -sf /var/lib/mysql/mysql.sock /tmp/mysql.sock