Consolidating Multiple WordPress Multisites into One

I did some research but couldn’t find any good literature on how to consolidate multiple instances of WordPress Multisite into one instance. To be clear, I have three multisites and want to merge them into one; is there a good/easy way to do this other than exporting/importing all of the sites manually?

Related posts

Leave a Reply

2 comments

  1. Here’s one answer that I found- it’s not fast but it definitely works.

    I will refer to first MS as the multisite that you want to remove a site from and second MS as the multisite that you want to add this site to.

    Step 1

    In phpmyadmin or similar for first MS, export the tables relevant to the site that you’re taking. It’ll probably look something like:

    • wp_7_commentmeta
    • wp_7_comments
    • wp_7_links
    • wp_7_options
    • wp_7_postmeta
    • wp_7_posts
    • wp_7_terms
    • wp_7_term_relationships

    I’m going to call the site number the number corresponding to the middle number in the DB tables. In this case, the site number is 7.

    Step 2

    Go to phpmyadmin for second MS and see what the largest DB site number is.

    Step 3

    In a code editor do a find replace for your current site number and replace it with a site number that is one larger than the biggest site number in the second MS DB. For instance, if the largest site number in second MS was 460 using the example above I would do a find/replace for “wp_7_” and replace it with “wp_461_”.

    Step 4

    Once you’ve done this, import the updated .sql file into the second MS DB.

    Step 5

    Enter the options table for the site you just imported (now wp_461_options) and make sure that the “siteurl” and “home” options correspond to the new site.

    Step 6

    Go to the wp_blogs table in the DB and insert new information for the site you just added. Be sure that the “blog_id” corresponds to the site number you just created (in my example I would make sure that “blog_id” was 461).

    Step 7

    You should now be able to safely change the nameservers on your domain to the second MS and it should work.

    If anyone knows of a way to automate this, or to make it easier to do in bulk that would be phenominal. Otherwise this way will work, albeit slowly.

  2. There are a number of 3rd party tools which can make the process a whole lot simpler – BackupBuddy for example can deal with exporting Multisite sites and importing them to existing installs.

    I’ve used this successfully to move a few sites around, but success rates can often depend on how many user accounts are involved as Multisite maps all accounts onto a single table of accounts.

    IMHO, unless there’s a very good reason to consolidate them, it can often be a whole lot easier to keep the installations separate.