Migrating To A Dedicated Server

I’ve frequently had to migrate websites from one server to another over the years. It’s not rocket science, but if you don’t have a plan and a very clear mental picture of what you need to do, things can quickly go awry.

So, here is my “typical approach” for migrating a server that runs a script (e.g., a directory site, a traffic exchange, etc.) and a MySQL database. Assume that the previous domain was domain.com and the new IP address is 1.2.3.4.

  • Step 1: Send an email to your list of members 48 hours prior to the relocation.
  • Step 2: On the new server, create the domain.com account (CPanel, etc.).
  • Step 3: Take a complete backup of all server data and MySQL databases, then restore them on the new server. Backup the MySQL database (s).
  • Step 4: Edit your Windows hosts file (C:WINDOWSsystem32driversetchosts) to include the new IP address for domain.com.
  • Step 5: Open a CMD window and type the command “ipconfig /flushdns” to flush the Windows DNS cache.
  • Step 6: Open your web browser to domain.com in Step 6. The hosts file entry should result in it now opening on the new server. Place a comment like in the home page file (index.html/index.php), just to be sure. Thus, you may simply inspect the homepage’s code to confirm that you are indeed on the new server.
  • Step 7: Test EVERYTHING. Examine the script. If it contains an administrative section, test the administrative functions. Follow each link and verify that everything is functioning properly.
  • Step 8: Once you are certain that the new site is functioning properly, place an alternate homepage on the old server that states, “We are migrating to a new, quicker server.” We regret any trouble that this may create. Now, restart the server. This will log out everyone who is presently logged in.
  • Step 9: All files should be fine (unless you have some sort of funky file-based database). It is now time to do the “actual” database backup. You do not want anyone to lose any data, so you must take another backup of the database at the point where you disabled logins.
  • Step 10: Deleting the database from the new server and restoring the database backup from the old server. Now that you have the most recent database information, everyone should be pleased to log back in.
  • Step 11: Update the DNS configuration at your registrar to point to the new DNS servers.

That’s all there is to it. Eleven simple steps to a seamless server relocation:). There may be the occasional user who reports reaching the new server but then being redirected to the old one.

That has to do with DNS propagation, so you may confidently say, “Give it a little more time, and everything will be OK.” If you continue to see or are notified of problems after 72 hours, there may be an issue with the DNS configuration on the new server, but it would have to be a rather evident error that is easy to fix.