elegant themes

6 things to remember when moving WordPress blogs to a different host

| July 8, 2008 | 34 Comments

I recently had to move all my WordPress sites and blogs to a new server because Bluehost sucks. My sites were going down on a near-daily basis for way too long, and they couldn’t care less. So I did what I really did not want to do, and moved six WordPress sites to a new hosting provider, which has proven itself with my clients’ sites: Hostgator. And along the way I’ve learned quite a few things about what to pay attention to when moving WordPress sites from one place to another, which I’d like to share.

Lesson 1: WordPress’ native XML export is not good enough

In WordPress, you can easily export a site by going to Manage > Export, which will create a unique XML file that you can import in any new site. This is fine for a very simple, single-user blog without heavy customizations. However, if your blog has multiple users, and if you have added info to their profiles, that info will be lost in this export. In addition, all users will be given a permission level of Subscriber, which is annoying if you need to go and change everyone back to their original permission level.

Also, if you have installed plugins that created new tables in your database, these will not be exported.

And, if you had any links saved, this will not save your links. See Lesson 6 below for more information on this, but the point is that the only way to save your links AND their categories is to export your entire database.

Therefore, in order to retain all settings and information that your site needs, the only way to do so is to export your entire database, and then import it to the new WordPress installation.

Exporting and Importing a WordPress blog

Here’s how you export and import your WordPress database. WARNING: Messing with databases in PHPMyAdmin can be hazardous to your health and to the health of your site. One wrong move and everything will be but a distant memory. So make sure to backup like crazy; and I take no responsibility for any harm you may come to by following my instructions. Now, let us begin:

  1. Log in to PHPMyAdmin via your control panel or however else you log in.
  2. If you have multiple WordPress blogs on one server, you may see a list of databases in the left-hand sidebar. Make sure you are dealing with the right database. The way that I check which database is the right one is by browsing the database and viewing the information there, whether it’s posts or even meta data like the blog name. To browse, click on the browse icon next to a table’s name (Note: your PHPMyAdmin interface may look a bit different, depending on the version you are using):
    Browse database tables in PHPMyAdmin
  3. Once you are sure you are in the right database, click on Export at the top of the PHPMyAdmin toolbar:
    Export database in PHPMyAdmin
  4. On the Export screen, I usually leave all the settings as is, but I do make sure to to 2 exports: a compressed (gzip) export, and a regular export, just in case. So export one while selecting None, as shown below, and one while selecting gzipped:
    Compress export file in PHPMyAdmin
  5. Now on to importing: install WordPress on your new server.
  6. Go in to PHPMyAdmin for your new server, and delete all your tables for your new WordPress installation (Yikes!). In PHPMyAdmin, to delete is called to “drop.” So on your main database page, select all your tables and click on Drop, or on the red Xs next to the table names:
    Drop tables in PHPMyAdmin
  7. Now, import your exported WordPress database into your new installation. To do that, stay in PHPMyAdmin for your new site, and click on the Import tab that is to the right of the Export tab on the toolbar (see image in step 3 above).
  8. Browse to find your exported database file. Leave the rest of the settings, and click Go.
  9. Now your old WordPress database is in your new installation. It may work at this point, so go check. If it does, great. If not, continue reading.
  10. You need to make sure that your database table names work with the new installation of WordPress. This means the following: if you installed your old database with Fantastico, all your database tables have a prefix of wp_. If you didn’t install it with Fantastico, the database tables probably don’t have a prefix. Your new database tables may have a different naming convention depending on how you installed it. So, take a look at your database table names, and note if they start with wp_ or not. Now it is time to open wp-config.php.
  11. Once you have opened wp-config.php, look at line 16, which says something like this:
    $table_prefix = ‘wp_';
    If your database tables start with the wp_ prefix, leave the line as above. If they don’t have a prefix, change it to:
  12. $table_prefix = ”;

Now your blog should mostly work (I hope)! But there are a few more things that we need to take care of:

Lesson 2: Widgets are not preserved with an XML backup, even with a full database backup

If you are using widgets somewhere in your blog, you will have to redo them one by one on your new blog if you use the XML backup. So take out a pencil and paper, and write down exactly what widgets you are using, what order they’re in, and any modifications or customizations that you made to them. Ok, you can use Word or Notepad if you want, but that’s about as technologically friendly as you can get.

Lesson 3: In addition to backing up your theme and plugins folder, remember your Uploads folder!

In your blog under Settings > Miscellaneous, you have set where any uploaded files or images will be stored. Make sure to backup that folder, in addition to your theme and plugins folder, so that you will have all those files in your new blog. In your new blog, go to Settings > Miscellaneous and make sure it’s pointing to that re-uploaded Uploads folder.

Lesson 4: Make a note of your site’s permalink structure

You want to retain the same permalink structure for your new site so that you can continue to enjoy the same traffic you had before from search engines and incoming links. So make note of your permalink structure, and once your new blog is installed, make sure to go to Settings > Permalinks, and set the same structure there.

Lesson 5: Don’t forget your favicon

Your favicon can get lost in the shuffle. Make sure to back it up, and upload it to your new site.

Lesson 6: It is hard to preserve WordPress blogroll links and their categories

Here at WordPress Garage, I had a page until recently called “Links we Love.” I had painstakingly added, categorized and described many links that I thought were useful to my readers. Well, during the whole server move, the links got lost because we didn’t export them by going to wp-links-opml.php, and saving that OPML file as a text file for importing later. In any case, even if I had saved that and imported it here, I would have lost all my categories anyway. So just note that if you’re depending on the XML backup, you will lose all your links. If you back up your links with the OPML file, you will lose your categories.


To sum up: try not to ever have to move your WordPress blog from one server to another, and you will add years on to your life.

Happy blogging!

Tags: , , ,

Category: Tips

About Miriam Schwab: Miriam is the friendly CEO of illuminea, a WordPress design and development agency. Miriam is a huge fan of WordPress and has been using it for over five years now. In addition, Miriam and her team have been organizing the local Israeli WordCamp conferences for the past few years. View author profile.

Comments (34)

Trackback URL | Comments RSS Feed

  1. IndieLab says:

    Good advice, thanks for the detailed explanation. I run many different WP sites and fortunately I haven’t had to switch hosts. Let’s hope it stays that way:)

  2. Herve Kabla says:

    Backups, backups, backups!

  3. Jennifer says:

    Great advice, Miriam, and it certainly explains why some on com have a less than satisfactory experience moving to a self-hosted wp install. No access to the db file. :(  Nonetheless, I’ve bookmarked your post for when the time comes.

  4. Guillaume says:

    Most of the time, the local path will change when you switch servers. You will need to update the “postmeta” table and update the field “meta_value” (which is a serialized array). I won’t go into detail, you will probably do a better job.

  5. carsten says:

    The description given is good, and almost complete. Will be difficult to make mistakes using it.

    However, if “moving to a different host” implies changes with the domain or subdomain, the WordPress database needs an extra change done. It can be done in PHPMyAdmin too: podz described this in some detail.

  6. Miriam Schwab says:

    @IndieLab – although moving WordPress is possible, as I explain here, it is not fun, so I hope that you don’t have to go through that!

    @Herve Kabla – that is for sure!!

    @Jennifer – this guy with a blog on Israeli wines just moved his blog from .com to .org, and last I heard from him his images had disappeared, poor guy. But, if it’s any consolation, we moved a site from .com to .org for a client, and it actually went quite smoothly.

    @Guillaume – I’d love to hear more about what you’re talking about. Can you elaborate?

    @carsten – thanks for that useful link. Now I really pity someone who not only has to move their blog, but also change their domain name or URL structure. Ugh.

  7. fr33mumia says:

    I’ll definitely bookmark this post .. nice tips Miriam .. I’m also thinking of moving my blog :D .. thnx again

  8. […] tips/6-things-moving-wordpress-blogs-different-host/ Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. […]

  9. I was considering moving hosts until this… sounds like QUITE the headache!  ugg.

  10. Miriam Schwab says:

    @Cathy – definitely think twice before moving hosts. It’s not fun, and it’s almost inevitable that something won’t quite work anymore the way it did before you moved it.

  11. Miriam Schwab says:

    @fr33mumia Thanks for bookmarking, and glad to help!

  12. Rick says:

    This was a huge help.  Thank you very much for posting this!  The character set turned out to be the culprit with my migration.


  13. dev says:

    can u post “how to create database for wordpress using PHPMyAdmin “

  14. thee says:

    I’m tryin to move a client of mine’s wordpress blog from 3ix to Network Solutions. I’ve tried contacting customer support for both of these places but haven’t recieved any help. I got everything switched over, but it looks like it isn’t linking with the database. I’m so stuck.

  15. Mayank says:

    nice post, but instead of all these hassles. I would instead suggest you to follow the tutorial which I’ve written recently on easiest and quickest way of moving wordpress.

  16. Lorenzo says:

    I would like to see a more modular approach to this problem.

  17. Guy says:

    @thee- the most important thing is to have the details correct in wp-config.php – you need the correct username, database name and password and make sure the domain is right as well- e.g. for Dreamhost you can’t leave it as ‘localhost’, it has to be the actual mysql domain you created when you set up the database so it would be something like mysql.yourdomain.com instead of the default ‘localhost’.

    If you double check all that you’ll probably find where you’ve gone wrong. :)

  18. Good advice Guy, this is some wording in the WP installation documentation that gets people a lot. “You’ll use localhost 99% of the time”.

    I run dozens of WP blogs and on different hosts, some require localhost, some require the mysql domain.

    Good for people to know:)

  19. […] 6 things to remember when moving WordPress blogs to a different host | WordPress Garage Very helpful in a recent move of a WP install (tags: wordpress backup) […]

  20. I have a problem with importing WordPress: I use phpMyadmin to export and import WP, everything is ok but WordPress doesn’t work.

    When the first time I try new WP at http://newdomain.com, it redirects to http://olddomain.com. So I change 2 options in WP database (blog link and home link) to http://newdomain.com and it doesn’t redirect but the page is white at all.

    I don’t know the reason why. I’m using WP 2.6.2, do you have an advice for me? Thanks.

  21. Guy says:

    @FreewareCollection: you could try going to wp-admin/upgrade.php and seeing if your database needs an upgrade, and also check the permissions are not too restrictive on the WP files.

  22. Shirley says:

    We recently released the Update URLs plugin which helps update permalinks and deep links after a domain switch.

    Check it out at: http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/

  23. CT says:

    I made the same exact migration as you, from BlueHost to HostGator. But I must have lucked out, because transferring the whole she-bang was fairly trouble-free. The only hangup was getting HG’s techies to import the WP database backup, because mine’s too big to upload remotely. I do have a fairly basic blog setup: Single user, minimal plugins, little/no MySQL tweaking.

  24. […] is not for the fainthearted. Being a seasoned member of the fainthearted club, and having just moved all my blogs and sites from one host to another, I think I’ll wait a bit before upgrading, as […]

  25. Sommer Zinger says:

    To start earning money with your blog, initially use Google Adsense but gradually as your traffic increases, keep adding more and more money making programs to your site.

  26. […] 6 things to remember when moving WordPress blogs to a different host […]

  27. great detailed information, bookmarked your page, thanks!

  28. I wanted to move a blog few days ago and have been looking for information but everything seemed so complicated.
    Your information seems very detailed and I will give it a try. Thanks .

  29. Just make a full file and SQL dump ( not forgetting the uploads! ), create DB on new server/host, upload/import all stuff, edit your config file AND the url & home settings in your options table.  ( Otherwhise it will redirect if you have a new/other domain/subdomain name ! )

    Tataa… thats it !
    ( ok … you might need to chmod some files due to uploads/plugins )

  30. Bingo says:

    Use XCloner for WordPress, I’m happy with it, here’s the link…

  31. […] I found a great post by Miriam Schwab (girl power!) called 6 things to remember when moving WordPress blogs to a different host — Finally, I found my […]

  32. Excellent post, I will bookmark this post in my Newsvine account. Have a awesome evening.

  33. Aj says:

    Awesome instructions.

    I think most people forget to check the wp prefix settings and that can really screw you.

  34. chat says:

    thank you very much very nice article =)

Leave a Reply

If you want a picture to show with your comment, go get a Gravatar.

More in Tips (35 of 96 articles)