3 Efficient Tools for WordPress Database Migration

photo credit: Don McCullough - cc
photo credit: Don McCulloughcc

One of the challenges of migrating a WordPress site is performing a search and replace within the database to update all of the links to the new URL. There are even more links to update on a multisite installation and you’re often working with a larger database. Today we’re going to look at a few handy tools that will make your life much easier when migrating a site. The tool you select usually depends on when you prefer to perform the search and replace.

Migrate DB Plugin: Requires Admin Access

If you have access to the WordPress admin, one of the easiest ways to make the changes up front is to use the Migrate DB plugin. Jeff recently reviewed it if you’d like to read more about how the plugin works. Essentially, you input your new URL and file path and the plugin exports an updated version of the database, which you would then import into an empty database on your new server.

WP DB Migrate Options
Changing the site URL is easy!

Search and Replace WordPress Plugin: Requires Admin Access

In the event that you’ve already moved the site over to the new server and have already imported the database, you have a couple different options for performing your search and replace. One of them is to use phpmyadmin or a similar tool to update the home and site URLs so that you can get back into the WordPress admin. At that point you could use a plugin such as Search and Replace to update URLs, site name or anything else that’s necessary.

This plugin lets you search over all or perform a more specific search in ID, post-content, GUID, titel, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories and categories-description.

Search and Replace DB Script: Does Not Require Admin Access

Another option that I’ve used many times is the Search and Replace DB tool. It’s not a WordPress plugin, but it’s very easy to use. This script preserves serialized PHP strings when performing a search and replace. You upload the script to your site, scan all the tables and then input what you want to find and replace.

Scan tables
Scan tables

Although you can use this script with Drupal, Joomla or any similar CMS, it was made to work nicely with the unique requirements of WordPress migrations and includes a few key features:

  • Handles multiple nested serializations (sometimes present in transient values)
  • Handles multi-byte Unicode changes safely (important for internationalized domain names)
  • Option to skip guid column for migrating sites that are already live

The important thing to remember after using the Search and Replace DB script is that you must remember to remove it from your website once you’re finished. Otherwise, it poses a serious security risk.

Of course there are many more tools than those listed here that perform similar functions. These three above are ones that I’ve tested multiple times and found to be the easiest and most efficient for getting the job done. Do you know of any other outstanding migration tools? Let us know in the comments below.

16 Comments


  1. Thank you for sharing.

    I recently used the Duplicator plugin (http://wordpress.org/plugins/duplicator/) to move a WordPress installation from a shared host to a VPS. As it was an eCommerce site and prolonged periods of downtime were out of the question, I studied WP Duplicator carefully over a period of two weeks and during that time I made a couple of dry runs before actually switching to the new host.

    Duplicator is very elegant and robust, perhaps the author of this article would be kind enough to check it herself?

    Report



  2. +1 for duplicator if moving the whole site. I’ve used it dozens of times and it makes the whole thing really easy. Cory is really good on support as well.

    Report


  3. I’ve used Search and Replace DB by interconnect/it many times. It’s great for performing any search/replace tasks on a database.

    Report


  4. The command line is important too.

    I’ve worked with databases which are difficult (or impossible) to work with in PHP as they’re simply too big. Exporting a giant database with PHP, can often timeout long before the database is exported.

    Using the command line avoids those problems. What might take an hour to export via PHP, can be done in 30 seconds or so via the command line. There is a huge performance advantage, and I’ve never had anything time out when done via the command line. It’ll just keep on chugging until the task is complete.

    Report


  5. I am constantly migrating template sites, and have used several ranging from BackupBuddy to other trials from CodeCanyon to the many freebies in the repository. As to Migrate DB, it worked, but not always. On the other hand, I’ve been using Duplicator for a while, and thus far it seems to be error free, so I give it a +1.

    Report


  6. All three of them are great tools. +1 on Duplicator too.I have used it many times and it works like a charm.

    Report


  7. i been using wp migrate db pro recently (premium plugin) they just did an attachment addon which is great also, and they allow push and pull so you dont even have to backup the actual db

    Report


  8. I did the db migration manually but i read a blog that says duplicator is the best plugin to use in migration as migrating db is not only the thing we need to migrate the content too. I am quite impressed with duplicator. The link is here :http://www.wpcares.com/migrating-wordpress-site-easily/
    if it helps

    Report


  9. You should check the GoLive plugin.

    It’s an All-in-one complete solution for migration, it covers all use cases (server to server, lcoal to server, export/import as zip).

    It updates the serialized data properly, and even the .htacess (to keep permalinks working).

    Link: *removed*

    Report


    1. I approved your comment but removed the link to your plugin on CodeCanyon because as far as I can tell, its license is not GPL compatible.

      Report


  10. It say’s for the search and replace php script that “You upload the script to your site, scan all the tables and then input what you want to find and replace.”

    For us novices, upload it where and how do we execute it?

    Report


    1. Hi Terry,

      You need to upload the searchandreplace.php to your web hosting provider. This is normally done via FTP, Plesk or CPanel control panel – the settings will differ depending on your host. After uploading the file, you should be able to navigate to your old URL of http://example.com/searchandreplace.php & fill out the information to do the search & replace (Note: if this doesn’t work you may have uploaded it to the wrong folder or something is blocking access to the file such as htaccess). You can then transfer the wordpress files & DB to your new host/domain. You should also remove the searchandreplace.php file as it’s a security risk.

      Kind regards,

      Morgan Robertson
      Sys admin
      morganrobertson.net / ambient-it.com.au

      Report

Comments are closed.