Migrating from one dedicated linux server to another?
My suggestion is to take backups of everything and restore it on the new server. Ie:
- Dump databases and restore them on the new server
- Copy webserver, database, email configs on the new one
Of course it requires a little downtime. There are some things you can do to make the downtime smaller:
- Do a previous rsync for all email data, then after everything configured and tested stop the service on the old server, rsync only the new data and start the new server.
- Use mysql replication to keep data on both servers until the time to 'switch'
- The rsync approach can be used with all other data (even db, but I suggest you to use a dump or replication to minimize the choice of error).
Also remember that this is a procedure that needs to be carefully planned and executed or data loss may happen.
You may be interested in exploring the possibility to use FSArchiver, http://www.fsarchiver.org/Main_Page
A few relevant things I've learned by trial and error (mostly error):
- Document the steps as you go so you have a record the next time you do it (there will always be a next time). That way you won't forget any steps and it permits someone else to do it as well.
- If you can switch components piece by piece it will be easier to diagnose issues. For example, keep the mail/database on the original server and just move the web server to the new server. Skip this if your application cannot easily handle inter-server but it is something to consider if you need to scale your system to multiple servers. This method is particularly useful if you need to minimize downtime.
- I wouldn't try just copying the raw database files from one server to another unless you are sure the database supports it. If you just have a few 100MB of databases I would just create a dump on the old server and restore on the new one. For larger databases it will be significantly quicker to setup replication.
- If using rsync or scp to copy files from one server to another make sure the user you use has read permissions for all the files. For example, I once used rsync to copy over some files from /etc but didn't have read permissions for some files. By the time I found out some files were missing it was too late (the old server was wiped). Since then I have always used tar as root on the old server to backup directories and then rsync/scp the tar archive over.