Categories
blogging WordPress

How I move a WordPress blog to a new host

Aaron Brazell described how he moves his WordPress blog to a new host and it’s very familiar since I’ve done something similar a few times over the last few months.

I’ve figured out a few things from those moves which you might find useful if you get sick and tired of your hosting:

  1. If you’re self hosted and have a domain name, set the “time to live” (TTL) to as small as possible, say 15 minutes. You should do this about 24 hours previously. Doing this will mean that visitors to your bog will start seeing your new host sooner!
  2. Just after you dump your database to a file for export close all your posts to comments. I do this with the SQL, UPDATE wp_posts SET comment_status='closed'. Now quickly transfer your db over and get your site up and running in the usual manner. Your old site will still get traffic for a while yet. Googlebot will still visit too, but nobody will leave comments there so you don’t have to worry about synchronising your comments table. You could do the same with ping_status too if you get a lot of pings.
  3. For extra brownie points add a small message in the comment area informing the visitor that, “Comments are disabled. This site has moved to new hosting. Please check back later to leave a comment.”
  4. If you fiddle with your hosts file make sure there isn’t an entry for your domain pointing at the old site. That happened to me on my Macbook and even after updating /etc/hosts it still didn’t work right. I had to reboot the laptop!
  5. Say “Thank You” to anyone who helps, especially support staff!

Good luck moving, it’s not as hard or as daunting as it might be. ssh, scp/rsync, mysql/mysqldump and tar/gzip are your friends when moving!

Further Reading:

PS. Thanks to Linode for hosting, Blacknight and Michele for DNS, and you for WordPress.