If both mysql servers are down: rsync
-ing the datadir
(which I assume is not in rc.d
, as that would be weird?) before staring them both is not a problem, and works fine as long as the version of mysql
on the new server is higher or equal (you may need to run mysql_upgrade
on a higher version).
If the first is running, you preferable want a master-slave scenario, starting from a hotcopy. With Percona's Xtrabackup
you can back up a live database including InnoDB table with the minimal amount of locking possible (but some locking still occurs!), you copy that datadir to the new server. Now, it is as 'in sync' as you can get it, but the 1st server is still working, so data is changing constantly. To get it in sync with those changes again set it up as a slave at the point stored in the xtrabackup_binlog_info
file.