I have a task to move linux server from 1 dedicated server to another.
In general my plan following:
- night time - turn off httpd and mysql. RSYNC via SSH.
- day time - turn on http and mysql.
- night time turn off httpd and mysql. RSYNC via SSH.
- night time. turn on httpd and mysql on both servers. Change DNS entries.
- day time. monitoring server status.
So mostly both for syncing mysql and httpd I would use rsync(no mysqldump).
Sounds good? Any caveats?
I suggest two solutions. Personally, I prefer the Logical Clone method because it can be done with less downtime, and database replication is a versatile capability to acquire for other reasons. However, the Exact Clone method, which is similar to what you proposed, is a generic brute-force approach to migrating any server.
Exact Clone
Logical Clone
Look into setting up MySQL replication. If you don't already have binary logging enabled on your MySQL server, you'll have to briefly bounce your database to enable it. In any case, I highly recommend enabling binary logging anyway because it is handy for doing future operations like upgrading MySQL with nearly zero downtime.
If you set up circular replication, you might even be able to run both the old and new webservers simultaneously, if MySQL is your application's only data store.