Moving Day: A Guide for Moving One WordPress Site to Another

One of the best parts of WordPress is just how easy it is, not only to import content in from other content management systems, but to export and take all of your content with you out of WordPress itself. There isn’t the feeling, like with so many systems and web apps out there, that you are deliberately being locked down into using one particular system. And like anything, there is an art to moving your WordPress site from one location to another.

Moving Day post graphic

Why move?

There could be any number of reasons for moving your site to a new location. Perhaps you are changing hosting providers (as we all do at one point or another) and are moving all of your stuff someplace new. Most of the time, for me, it’s because I’m setting up a client’s site based on a local or remote testing installation.

A better question would probably be: why test? More often that not you will be moving a WordPress site to a new location because you first had it in place, testing it. And this is only smart. Live testing, where people know how to find it, is never smart. Testing it in secret can help you foresee and diagnose many of the potential problems, and help you save face once you turn it live.

In the 100 or so odd times I’ve moved a WordPress site from one location to another, I’ve casually put together a mental checklist that I go through to make sure I hit all of the points I need to, and to speed the process up. Consider this a mental brain dump, for your benefit.

First things first: handle your content

The most important part of your site, you’ll want to move over your content first. When I say content, of course, I’m talking about a couple of different things. Most obviously it’s your database export. You can grab the XML file of that content at Tools > Export. This is pretty straightforward, and shouldn’t really confuse you.

If you are moving from one remote host location to another, then moving content is pretty simple. In your new WordPress installation, go to Tools > Import and select the file you just exported from your other site. Be sure to check the box that will download and import all of the files from the other site you’re moving from. This will grab any images/files you uploaded and reconstruct the uploads folder appropriately.

If you’re moving from a local WordPress site to a remote one (let’s say you’ve been testing locally, for instance) then this process is a little bit more difficult. You can’t actually trust WordPress to find and import all of your files, since your site is hosted locally, and WordPress won’t look on your computer. So in this case you’re going to have to grab your wp-content/uploads folder manually, and move it over.

The easiest way to make sure all of the files are linked up correctly throughout your site is to use a nifty Plugin called Search and Replace. It will run through all of your content — pages, posts, everything — and replace any string with another string. So, have it replace your original site’s URL (only the beginning, before the /wp-content part starts) with your new one. This should cover your bases pretty well.

Move over relevant Plugins

Now turn your gaze to your wp-content/plugins folder. One of the reasons I like testing before pushing a WordPress site live is that I often go through a couple of Plugin options when solving simple problems. Odds are that I’ll have a number of Plugin choices that I didn’t use lying around, cluttering things up. So when I push everything to its live location, I’ll only take the Plugins I’m actually using. I suggest you do the same thing.

Match relevant settings

You’ll want to make sure that your settings are the same between your two installs as well. The easiest way to do this is just to open up two tabs and run through all of the screens within your Settings tab of the Dashboard and make sure everything is the same. Depending on the number of Plugins you normally run, this may be a fairly large endeavor.

A couple of things I always watch out for:

  • Be sure that the home page and blog page are set correctly on the Settings > Reading page.
  • Check that your comment settings (in Settings > Discussion) are set the same, specifically the number of threaded comments you’re allowing.
  • Set your permalinks (Settings > Permalinks) to be what you had them before. Otherwise, any linking you did within your site will likely be screwed up, even using the Search and Replace Plugin.

Note: If you do happen to change your Permalinks structure, use a Plugin like Redirection to send URLs to their new locations.

What do you do when moving your sites?

Every site move brings its own problems and frustrations. Odds are you’ve discovered your own methods for making this a painless process, and that you’ve come across some ideas that I haven’t. Speak up in the comments.

Leave a Reply