WPMDB Pro 1.3.1 and Media Files 1.0.1 Released

By Chris Aprea

WP Migrate DB Pro 1.3.1 and Media Files addon 1.0.1 have been released and are now available for download. We don’t usually do a blog post for minor releases like these, but we think there are a few key things that deserve to be highlighted.

Domain Find & Replace Field Removed From Multisite Migrations

In earlier versions of WP Migrate DB Pro we included 3 default find & replace fields when migrating WordPress multisite install. The third replace was targeting the network’s primary domain name.

As such, a typical find & replace section would look like this:

Find Replace
http://stagingsite.com http://livesite.com
/path/to/stagingsite /path/to/livesite
stagingsite.com livesite.com

We were finding that some people were running into problems with the third find & replace field as it was sometimes replacing the domain name in email addresses.

To remedy this, we’ve removed the third find & replace field entirely and instead automatically replace the domain name on specific tables during the migration.

If you’re using WordPress multisite and have a saved profile that contains the domain name find & replace field, it should probably be removed once you’ve upgraded to WP Migrate DB Pro 1.3.1.

Support for Domains  Mapped Subsites

We’ve added better support for multisite in this release, adding a convenient filter for domain mapped subsites: wpmdb_domain_replaces. Here’s an example of how to use the filter:

function domain_replaces( $replaces ) {
    $replaces['/bananas.dev/'] = 'bananas.com';
    $replaces['/apple.dev/'] = 'apples.com';
    return $replaces;

add_filter( 'wpmdb_domain_replaces', 'domain_replaces' );

In this example, we’re replacing all the instances of bananas.dev with bananas.com (and similar with the apple.* domains).

Please note the following:

  • The filter passes an associate array.
  • This filter results are fed into a preg_replace() function call
  • Ensure your array keys are regex compatible pattern searches
  • Ensure your array values are the replacement strings for your pattern matches

These replaces will only occur on the wp_site and wp_blogs tables. This filter should exist on the website that is being exported. That is, the install receiving the pull request or the install being pushed.

Check out examples for all the WP Migrate DB Pro actions and filters in our WP Migrate DB Pro Tweaks plugin.

Protocol Removed From Find & Replace Fields

We’ve decided to remove the protocol from the default find & replace fields to target both http:// and https:// (and other protocols) styled URLs during migrations. So, your find and replace section will change from looking like this:

Find Replace
http://stagingsite.com http://livesite.com
/path/to/stagingsite /path/to/livesite

To look more like this:

Find Replace
//stagingsite.com //livesite.com
/path/to/stagingsite /path/to/livesite

Media Files Addon Documentation

While not a change to the code itself, we did receive some feedback that it was unclear how the Media Files addon was supposed to work. We’ve added a Media Files Addon section to our documentation to help clear that up. If it’s still unclear, please do let us know.

WP Migrate DB Pro 1.3.1 Change Log

  • New: Backup options to select which tables to backup
  • Improvement: Consistent styling for errors and warnings
  • Improvement: Make it more obvious when a migration has completed
  • Improvement: Add Media Files screencast to Help tab
  • Improvement: “Check Again” on the WordPress Updates page will force the plugin to check for a new version
  • Improvement: Better multisite find and replace
  • Improvement: Remove protocol from default find and replace fields
  • Improvement: Better handling of poorly configured SSL servers
  • Bug fix: Better debugging info for API requests to deliciousbrains.com
  • Bug fix: Backups not working with multisite migrations
  • Bug fix: Find & replace fields become reversed
  • Bug fix: Basic authentication not working when there’s an ‘@’ character in the username or password
  • Bug fix: Detecting wrong installed version of the plugin
  • Bug fix: SSL disabled message appearing when connecting without HTTPS
  • Bug fix: Replace GUIDs will not stay unchecked when saving profile
  • Bug fix: Dead end after error in the UI
  • Bug fix: Backup option only backs up tables to be replaced
  • Bug fix: Undefined ‘path’ index error
  • Bug fix: Primary key of zero not kept in migration

Media Files 1.0.1 Change Log

  • Bug fix: Error if the uploads directory doesn’t exist yet
  • Bug fix: MP3 files not migrating
  • Bug fix: Basic authentication not working
  • Bug fix: Not working with “Organize my uploads into month- and year-based folders” unchecked
  • Bug fix: Additional letter appended to the start of each filename
  • Bug fix: Login prompt after database migration and before files migration starts
  • Added a little documentation

About the Author

Chris Aprea

Chris wrote a ton of code and helped lots of customers for Delicious Brains during his 2-year stint with us. He has since moved on to other things.