Moving Day – A New Web Server

Tools TileI completed moving this website to a new server over the past weekend. I’m still using Linode as my host and running on a 512 MB Virtual Private Server (VPS). The changes were minor and should be transparent. I moved from Ubuntu to Debian as the OS but since Ubuntu is based on Debian there’s not too much difference. I had a few strange things happen on Ubuntu after updates so I’m hoping for a little more stability without actually having too learn anything new. Of course, soon after going live I had problems which seemed to be related to an update on Debian. So much for stability as a reason.

As I was building the new server I also worked to squash some annoyances and did some testing. I’d been having problems posting updates through xmlrpc (for example, from Windows Live Writer) to all my sites except this one. That problem didn’t exist on the the new server. I also had some scripts which stopped working as expected and these worked fine on the new server.

The major change (relatively speaking) was I switched Apache from using pre-fork MPM and mod_php to using worker MPM and mod_fcgid.  Worker-MPM was the default when I installed Apache on Debian so it was easy enough to get Apache working. Getting mod_fcgid and mod_actions to handle php was a little more complicated but not too bad. This has reduced the memory usage by the server since php isn’t running with each Apache instance. Performance seems to be about the same.

I considered switching to nginx from Apache but I decided I didn’t want to much change and I didn’t want to spend the time learning nginx. Staying with Apache meant that I would be keeping most of my configuration. Maybe sometime in the future.

I only made a couple changes to WordPress itself. There were some updates related to security keys in the WordPress configuration file. It’s been awhile since I updated that file so I was missing a lot of keys. Now I have all the keys and salts used by the current version. I also changed the database name and user to match my current naming convention.

My checklist for the move is below:

  1. Set the DNS TTL for the domain(s) to a low value (300 seconds) so the DNS change will take effect quicker for the actual move. Do this a couple days in advance.
  2. Backup all website files.
  3. Backup the database
  4. Backup the Apache site file
  5. Create the database on the new server – use the same name as the old server
  6. Create the database user – use the same name/password as the old server
  7. Copy the website files from the backup to the new server
  8. Copy Apache site file to the new server – edit the file for any changes such as IP address the site is on
  9. Restore the database from the backup
  10. Edit hosts file on new server so that the server resolves to itself for the website
  11. Edit hosts file on my PC so it resolves to the new server for the website
  12. Edit my permissions scripts to set file permissions for the site. Run the script to set/test permissions (I have a script I keep updated that will set the proper permissions each night in case I change them and forget to change them back or they get changed in an update.)
  13. Edit backup scripts to include the new site.
  14. Edit WordPress update script to include the new site (I update WordPress through svn)
  15. Update logrotate to include the new site
  16. Connect to the new server’s WordPress site (using the PC with the modified hosts file)
  17. Delete cache files for WP-Supercache and restart plugin (this plugin seemed to dislike being moved). Check the rest of the plugins.
  18. Test the website on the new server
  19. Make a minor change on the new site so it can be identified
  20. Change the DNS from the old server to point to the new server
  21. Allow some time for the DNS change to propagate. Access the site from a different PC or remove the entries from the local hosts file. It may be necessary to flush the cache when changing the local hosts file.
  22. Allow a few days to pass. Check the logs on the old server and if there’s no access (except some search engines and other web spiders) the server can be shut down.

The move itself went smoothly.

%d bloggers like this: