We’ve had some fantastic feedback on the “Export a subsite as a single site install” feature that our Multisite Tools addon for WP Migrate DB Pro enables. Chief of which have been “Hurry up with Push with media already!” and “How about importing a single site install into a subsite then?”. Well, guess what we’ve been working on recently…
Push a Subsite to a Single Site Install
In an upcoming version of our Multisite Tools addon, push migrations from a multisite install to a single site install of WordPress will have a “Push specific subsite” checkbox. Once you’ve picked a subsite from the list, the target table prefix is automatically set and the Find & Replace rows and list of tables are also updated to match. See the following screenshot for an example.
The list of tables you can select for migration is narrowed down to those specific to the subsite, plus the global users and usermeta tables.
All the other options usually available for a push migration are still enabled, including the Advanced Options, Backup Tables and of course Media Files.
This means that if you have the Media Files addon, you no longer need to hunt down the media files for the subsite and manually transfer them to the new site. Multisite Tools takes care of copying the files to the new site and ensuring all links to them are correct in the newly updated site.
The users pushed to the single site install are only those that are currently a member of the subsite, or are authors of migrated content.
To see this in action, check out the video at the top of this article that shows a speed run of pushing a subsite to a single site install, adding users and content and then pulling it back into a subsite.
Pull a Single Site Install Into a Subsite
The upcoming version of Multisite Tools also includes a “Pull into a specific subsite” checkbox when setting up a pull migration on a multisite install of WordPress that is connecting to a single site install. Now when you check the box and select a subsite to pull into, the target table prefix is automatically set and the Find & Replace rows and list of tables are updated as appropriate. The following screenshot shows an example of this.
All the other options usually available for a pull migration are still enabled, including the Advanced Options, Backup Tables and of course Media Files if you have the Media Files addon.
Multisite Tools takes care of copying the Media Library files into the subsite and ensuring all links to them are correct in the newly updated site.
Where possible, the users being pulled into the subsite are matched up with existing users via their username and email address, as long as they are also a member of the subsite already. If there is no match then the user is imported along with their metadata. Either way, the migrated posts and comments are updated to ensure the correct user record is referenced in the subsite.
Again, the video at the top of this article shows this in action.
Great Power, Great Responsibility
You may be thinking, “Finally, I can setup one multisite install for developing all my client sites.” While you certainly can do this easier than ever now, just because you can doesn’t mean you should. Instead, we recommend setting up your development environment to mirror the production environment as closely as possible. So if the site will be a single site install in production, set it up as a single site install in development. You’re much less likely to run into issues after moving the site to production if the two environments are similar.
Gimme gimme gimme!
Whoa, hold yer horses! This version of Multisite Tools is currently wrapping up development, and then we’ll be giving it a very rigorous testing phase to ensure it works as intended in as many scenarios as we can muster. The development for these features required some important changes under the hood of WP Migrate DB Pro, and sets up a strong foundation for planned future enhancements. As such, we can’t give you a date for when it’ll be available, but rest assured we’re working as hard as we can on it as we know it’s much sought after functionality.
Please post any questions in the comments below and we’ll do our best to answer them.