How to move a WordPress blog from one host to another

This post is about moving a self-hosted WordPress blog from one web host to another. If you're wanting to move from WordPress.com to self-hosted WordPress, that's a very much easier process, which will be covered in the next post.

My worst every serve move was for a friend who phoned me at 3.30pm to say that her hosting company were being shut down at 5pm: "can you help?!" As she had an ecommerce site with hundreds of product pictures we needed to back up, it was touch and go for a while. Which brings me to the most important point about moving servers: allow plenty of time. The bigger and older the site, the longer it's going to take. Don't expect it to be a five minute job; don't try and do it in a panic (you can always take a leaf out of my friend's book and hire me to panic for you ;-) ).

If you're just looking for the instructions on what to do, scroll down a bit, otherwise first I'm going to show my working.

Two problems face us when trying to move a WordPress blog:

  1. WordPress hard-codes the URL (twice) into the installation. Which is a problem because...
  2. domain nameserver changes take time to propogate. If blogmum.com was pointing at one host and I switch it, typically it takes around 24 hours for the internet to catch up with that. In the meantime, my blog and my URL are in no man's land.

So this gives us a choice. We can either move the domain name first and then install WordPress, or we can install WP on the new host with a temporary URL and then edit the URL in WP once the domain name change has propogated. I prefer the second option because it means that there is less potential for my URL to be pointing at nothing, with it looking like my blog is completely broken.

So if I'm moving a blog, this is the order in which I do it.


How to move a WP blog between servers

Key: OH = old host; NH = new host

  1. When you sign up for a new hosting account, they should give you some nonsense-looking temporary URL to use while your domain name resolves. If they haven't, ask em.
  2. Install WordPress on NH using the temporary URL.
  3. Install the plugins you've been using on NH. I prefer to download them again from the repository, just in case any nasties have sneaked in to your old install.
  4. Install your theme on NH. If you can install it fresh, do so; if you've customised it, copy it from OH (it's in the wp-content/themes folder).
  5. Copy the wp-content/uploads folder from OH to NH (this is all your images and other uploads).
  6. You're now ready to copy the actual content - posts, pages, categories, comments and so on - from OH to NH. You might like to close comments on active comment threads, or even install a plugin like Maintenance Mode so that people won't make comments on the old blog while you're moving, that you'll either have to copy over later, or lose forever.
  7. On OH's admin, go to Tools > Export, and follow the instructions.
  8. On NH's admin, go to Tools > Import, and follow the instructions.
  9. An identical copy of your old blog should now be on NH with the temporary URL. Now's the time to change your nameservers: your new host should have told you what to do here.
  10. Recently, the time taken for nameserver changes to happen has gotten a lot shorter. After about 12 hours or so, start checking what happens when you type in the old, "proper" URL. When you see it redirect to NH's temporary URL, you know it's pointing at the new web space,
  11. so go to Admin > Settings > General and change both WordPress address (URL) and Blog address (URL) to the proper URL.
  12. Check it's working okay; make sure nothing's missing from the old blog before you close down that hosting account!
Share this post:
  • email
  • del.icio.us
  • Facebook
  • FriendFeed
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Twitter

Tags:

Posted by Sue on August 28, 2009 in WordPress.

2 comments to "How to move a WordPress blog from one host to another"

  1. Seedbox wrote:

    Moving hosts is always very scary

  2. I have been procrastination in doing this because it scares me to death :( Thanks for these instructions, I might have the courage now

Leave a Reply