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

16 responses to “3 Efficient Tools for WordPress Database Migration”

  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?

  2. 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.

  3. 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.

  4. 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*

  5. 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?

    • 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

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.