6 Steps to a Smoother, Safer WordPress Move

Editor’s Note: Originally, I was going to run Part III of the Art of Perception series today. But in response to Brian Clark’s challenge, I am posting this article in its place today. I think this will be very helpful for those of you who are planning to move your WordPress blog to a new server.

~G.S.

wpmoving.jpgOnce it a while it happens: you find out you need to move your blog from one server to another. Perhaps you are changing server providers, or perhaps you want to move your blog from one of your websites to another (as was my case).

Now I know a little bit of coding, a little bit of database stuff, so I was fairly confident I could do move my blog without difficulty. I was wrong – I still got tripped up.

Part of the problem, I think, is that I was getting information from several different sources. This advice “mash up” led ultimately to two mangled blogs (original and new), lost data, and a cross-eyed headache.

But I learned from my mistakes. I have created an easy 6-step plan for moving your WordPress blog from one server to another that’s straightforward and painless.

Before You Start

This article assumes that you know how to access your server through your control panel, or are at least willing to learn. You will also need the following items:

  • An FTP program. I used Dreamweaver.
  • An HTML program or (if absolutely necessary) a text editor. I used Dreamweaver.
  • MyPHPAdmin installed on your server*
  • A database set up on your server*

*If you are not sure about how to do this, follow the steps to do this from the WordPress New Install instructions here:
http://codex.wordpress.org/Installing_WordPress#Using_phpMyAdmin

Terminology Note: The blog you are moving from, including the server, database, and files, is referred to here as “current”. The blog you are moving to is referred to as “destination”.

Step 1 – Back Up Everything

Here is a list of things you want to back up (specific instructions to follow):

  • Your Current Database
  • Your Current Blog files
  • Your Destination Database, if you have one

Current Database Backup (see image below)

  1. Log into your MyPHPAdmin
  2. Click on the Databases link
  3. Click on the database that holds your blog
  4. Click on the Export tab
  5. There are ten tables (as of version 2.3.3). Make sure all are highlighted/selected. If you are using the database for other applications, deselect any of those related tables.
  6. Ensure that “SQL” is selected below this list of tables.
  7. Select (put a checkmark) the “Structure” checkbox, as well as “Add Drop Table”, “Add Auto-Increment”, and “Enclose table and field names with back quotes”. Deselect everything else in the Structure checkbox.
  8. Select the Data checkbox, and deselect everything in that section except “Use hexidecimal for BLOB”.
  9. Select “Save as File” and add a filename. If you have a large database, you may want to compress it by selecting one of the ZIP file options, but generally this is not necessary.
  10. Click the “Go” button at the bottom right. You will be prompted to save a file to a folder of your choosing on your hard drive.
  11. Done!

blogmovedatabasebackup.jpg

Current Blog Files Backup

If you already have a folder called “blog” on your destination server and local hard drive, you will have to rename it or back it up before following these steps. IMPORTANT: Any information you do not back up will be erased in coming steps!

  1. Open an explorer window and go to the folder that contains your website on your hard drive.
  2. Create a new folder somewhere else on your hard drive.
  3. Right click the “blog” folder in your website, drag it to the new folder, and select “Copy” from the list.
  4. Using an FTP program, download all of the files from your server to your hard drive.
  5. Click “Yes” if it asks you about overwriting files (you just backed them up…)
  6. Using the same procedure as Step 3, right click the “blog” folder, drag it to the folder on your hard drive that contains your new server website, and click “Copy”.
  7. Done!

Destination Database Backup

If you already have database information on your destination server and you want to protect the information contained in that database, back it up using the same procedure described above in Current Database Backup.

Step 2 – Reconfigure Your Config

You may remember that when you first installed your WordPress blog, you had to add values to the wp_config.php file, including database pointers, passwords, etc. You will now have do the same for your new blog so that the database connects with the files on the new server.

In your HTML editor, follow the same instructions found here (http://codex.wordpress.org/Installing_WordPress#Step_3:_Set_up_wp-config.php). Note that instead of references like ‘putyourdbnamehere’, you will have the old information in place from your current blog.

Step 3 – Upload Your Files and Database

  1. Upload your files using any FTP program. Click “Yes” if prompted to overwrite.
  2. Upload your database by going to your MyPHPAdmin on the destination server.
  3. Click on databases, then the name of your database.
  4. Click on the “Import” tab.
  5. Locate the database you backed up from your current database on your hard drive by clicking the “Browse” button.
  6. Once selected, click the “Go” button, bottom right.
  7. Done!

Step 4 – Change Your Blog Pointers

The database on the destination server is a mirror image to that of the database on your current blog. The data contains “pointers” to your blog, and right now those pointers are leading visitors back to your current blog. All you need to do is change two pointers on the destination database to point it to your destination blog.

  1. Open the destination database in MyPHPAdmin.
  2. Click on databases, then the name of your database.
  3. There will be ten tables displayed (as of version 2.3.3). Locate the table called “wp_options”.
  4. In that row, click on the first icon. If you hover for a moment over this icon, the tool tip should read “Browse”.
  5. Many rows of data will appear. Find the column that says “option_value”. Scroll down until you find the URL of your current blog (it may be the top one).
  6. At the left of this row, you will see a pencil icon with a tool tip that says “Edit” when you hover over it. Click on this.
  7. Change the URL in the text box provided, and click the “Go” button, bottom right. IMPORTANT: double check that you have no spelling mistakes, etc. in the URL address, or it will not work!
  8. Scroll down until you find the URL of your current blog again, and change it following Steps 6 and 7 again.
  9. Done!

blogmoveoptionschange.jpg

Step 5 – Review the Destination Blog

  1. Log in to the destination blog the same way you do your current blog.
  2. You will probably have to re-activate all the plugins you have.
  3. You might want to take some time at this point as well to update plug-ins, and perhaps even your whole WordPress version, if newer versions are available. This way if you have any problems, you do not have to panic since this blog isn’t “live” yet!
  4. Done!

Step 6 – Change FeedBurner and Your Commenting Habits

The last thing you need to do is let the world know that you’ve moved. If you use FeedBurner for subscribers, then you can automatically redirect your subscribers’ feeds by going into your FeedBurner account, clicking on “Edit Feed Details”, and change the domain name in the “Original Feed” text box to your new domain location.

Note: this does take a little while to “propogate”, usually a couple of hours. I officially switched over my blog on a Sunday, my lowest traffic day, so that it would be least likely to affect readers.

You can also announce the move on your blog – I did pre-announcements to let people know. Also make sure that when you are commenting on other blogs, you add the URL of the new blog, not the old one.

And that’s it! Your new blog should be up and running just like your new one.

One side note about links: all incoming links will now be erased, and you’ll be starting at zero again. This is part of the price of moving — just look at it as an exciting new fresh start.

Making a move right now? Let us know how it goes by leaving a comment below — especially if you used this method!

~Graham

Tags: , , , , , ,

4 Responses to “ 6 Steps to a Smoother, Safer WordPress Move ”

Jonathan Kantor (2 comments.) says:

Whew! Sounds like a like to work for the technically-challenged! I have to upgrade my WordPress software and am cringing at the thought of all the work required!

I wish this stuff was as easy as upgrading a standard application.

Good work on your blog. I’ll have to chime on more often.

Jonathan

Jonathan Kantor’s last blog post..When White Papers Aren’t Appropriate

admin says:

Hi Jonathan,

Yes, I tried to make it as straight forward as possible, but there is no way around it: people are going to cringe when they read “backup the database” and “go to MyPHPAdmin on your server”… But really, it isn’t all that bad. As long as you really do back everything up before you start, there are no irreversible mistakes (though sometimes a little bit of frustration).

I haven’t upgraded WordPress since I installed it, but I imagine I’ll venture to that shortly…

Thanks for dropping by!

~Graham

How to Backup Your Blog Automatically | A Few Strong Words... says:

[…] how? I talked about it a little bit in a recent post dedicated to helping people move their WordPress blo… But there is an easier way, and best of all it’s […]

download(new comment) says:

Stumbled on your blog searching for some downloads. Nice to find good information on your blog. Read some of your posts and they are good. Thanks.

Leave a Reply