A Step-by-Step Guide For Moving WordPress From One Site To Another

wordpress-logoFor some reason, moving WordPress can actually be harder than developing for WordPress. I never noticed this before, because I had either developed directly on the client’s server, or had only worked with the basic skinning and CSS of WordPress itself. However, when you start majorly developing for WordPress; i.e. custom functions, changing the structures of page.php, single.php and index.php; as well as adding Pages and moving your index from the blog – well it starts getting a little complicated. We’ll start by preparing the old site’s files

The Old Site

  • Export the database – The database not only stores your posts, but your pages, ID’s and some general settings of the site, so unless you want to completely redo all of your pages and change where your navs and custom categories are pointing, you’d better export the database. WordPress makes this easy (for once). Just go under your left admin panel to Tools > Export and export your DB to a handy XML file.
  • Zip up the theme – Zip up your theme folder, located under wp-content > Themes > FOLDER
  • Jot down which plugins you’ll need to download on the new site.

That’s it for the old site. Sounds easy so far? This is where it gets a little tricky.

The New Site

  • Install WordPress – From a fresh clean install, don’t upload the old files. Set up your new DB connection.
  • Delete Everything – Delete all the sample posts and pages that WordPress automatically created. DO NOT add ANY new pages or posts yet. This is where a lot of people mess up. WordPress has a weird ID system that makes no sense, if you created the same exact pages from the old site in the same exact order, your page IDs will be messed up and therefor your nav and categories will be way off.
  • Import the DB – Now import the DB we created earlier by going to Tools > Import > WordPress. It will ask if you want to import the attachments as well. This is up to you – if your posts had attachments, then check the box. This should now create all the comments, posts and pages you had on the old site.
  • Change the front page – If, when coming to the site, your index doesn’t point to the posts page, but another page. Go back under Settings > Reading and change what page is supposed to be your homepage and what page is supposed to be your posts page.
  • Import the theme – Now it’s time to get that theme back into WordPress. Go to Appearance > Add themes > Upload to upload your zip files, or you can manually do it via ftp.
  • Download plugins – The easiest way is just to redownload your plugins, you’ll have less weird problems that way, so go ahead and do that now.

Check to make sure everything is correct. Are your links pointing to the right pages? Do your categories and tags show up correctly? Do your special functions work?