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