Migrating a server's DNS, websites, home directory and email

Q I have had a dedicated Linux server with a hosting company for about six years or so. As part of their customer-retention strategy they have arranged for me to upgrade to a newer server with better bandwidth allowance, SLA [service level agreement] and so on. The server is used by my very small business for email, web hosting, a testing server and managing DNS for domains that we own. A few friends and family also use the server for their email and web hosting. Is there a best-practice way of transferring DNS, websites, home directory files and email (Sendmail) to the new server with minimal disruption for myself and other users? I cannot afford to pay the hosting company's staff to do the transfer for me.

A Server migration, especially when changing distribution and versions (MySQL, Apache and the like), is never a straightforward procedure. However, it is a good opportunity to revise your current setup, and just as when moving house, you will come across a lot of stuff that can be thrown out. Also, this is a perfect opportunity to audit all your configurations and create and test backup and disaster recovery strategies. On the new server, set up and test all the zone files, email configurations, user accounts and websites. You can trick your workstation into believing that the sites are on the new IP by modifying your hosts file (/etc/hosts on Linux, c:\windows\system32\drivers\etc\hosts on Windows XP). DNS is the first target for migration. Point NS records at the registrar to the new name servers at least three days ahead of the planned switchover. Reduce the TTL ('time to live') on your new records to a reasonable 35 minutes so that on IP switchover visitors will clean their cached records of your IPs and pick up the new ones in no time at all. Set the TTLs back to a more internet-friendly value, say 24 hours, a few days after the migration. Depending on your budget and how critically reliant your sites are on a database back-end you may have to take extra precautions on the way you move over your databases. Finally, tend to your log files and web statistics. They're often forgotten during migrations.

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar