Migrating WordPress from Multisite to Single With MU-Migration

  • Website
  • Published Apr 15, 2019 Updated Jan 4, 2026

In addition to various commercial plugins, there is one free tool that helps with WordPress migrations to or from multisite installations. MU-Migration is a WP-CLI plugin that worked flawlessly when I wanted to convert helgeklein.com from a multisite into a single site installation. Here are the steps I took.

Migration Overview

When migrating a site with MU-Migration, you perform the following basic steps:

  1. Create a ZIP archive of your existing site (in a multisite installation, you can include only one or all sites)
  2. Set up a new WordPress site
  3. Restore the ZIP archive in the new WordPress site

That is (mostly) it. The remainder of this article covers the steps in more detail and lists additional manual steps I had to perform.

Migration in More Detail

The tool’s GitHub page gives a decent overview of what MU-Migration can do. Start by reading it.

Colorful Tape Drives by Don DeBold under CC

Installing MU-Migration

Make sure you have WP-CLI installed (I did). Install MU-Migration as follows:

wp package install 10up/mu-migration

Creating the Archive

Navigate to your site’s WordPress root directory. Run the following to get the ID of the subsite you want to migrate:

wp site list

To create the backup archive of your source site, run:

wp mu-migration export all ../helgeklein.zip --themes --plugins --uploads --blog_id=ID

This creates the ZIP archive helgeklein.zip with the following contents:

  • database export
  • directory wp-content/plugins
  • directory wp-content/themes
  • directory wp-content/uploads
  • migration metadata

What is Missing

In my case, I found the following to be missing from the archive:

  • Additional directories not part of the WordPress installation (e.g., a downloads directory)
  • .htaccess in the site’s root, which may contain custom rewrite rules
  • .htaccess in wp-admin, which may contain security hardening restrictions (details)
  • favicon.ico
  • Google site verification files
  • wp-config.php, which may contain custom settings
  • W3 Total Cache Configuration in wp-content/w3tc-config

Setting Up a New WordPress Site

First, I created a new database:

mysql -u root -p
mysql> create database wordpress_helgeklein;
mysql> grant all privileges on wordpress_helgeklein.* to "wordpress"@"localhost" identified by "PASSWORD";
mysql> flush privileges;
mysql> exit

As I wanted to perform an “in-place” migration from multisite to a single site, I simply created a new directory public_html_new on the same level as the existing public_html directory. Then I downloaded and extracted WordPress on my client machine, adding the missing pieces to the directory structure that I listed above.

As a next step, I renamed wp-config-sample.php to wp-config.php, transferred some custom settings from the existing wp-config.php over and updated the database connection information with the values I had just configured on the MySQL commandline.

After that, I uploaded the directory structure from my client machine to public_html_new. Then came the most critical part: replacing the old website directory with the new:

mv public_html public_html_old
mv public_html_new public_html

As the last step, I ran WordPress’ installation script from https://helgeklein.com/wp-admin/install.php.

Restoring the Archive

To restore the site archive in your source site, run:

wp mu-migration import all ../helgeklein.zip

With that, your migrated site should be up and running, though some manual steps might still be required.

Manual Steps

In my case, a number of manual steps were still required. I am listing them here briefly for completeness’ sake:

  • Enable plugins
  • Add entries to .htaccess required by W3 Total Cache
  • Add API keys to plugins: UpdraftPlus, Duo Two-Factor Authentication
  • Reconfigure plugins: UpdraftPlus

Other Things MU-Migration Can Do

MU-Migration could be useful in many more scenarios than what I described above. For example, did you ever consider setting up a WordPress staging site?

Comments

Related Posts

Guide: WordPress on Dockerized Apache on Hetzner Cloud

Guide: WordPress on Dockerized Apache on Hetzner Cloud
If you’ve followed this blog for a while, you may have noticed that I’ve used a traditionally installed (i.e., not dockerized) LAMP stack for its server setup since 2014. Only recently did I switch to Docker containers. Why? Maintenance. Much facilitated maintenance. If you take a look at the articles I’ve written over the years describing how to upgrade to newer versions of Ubuntu or - god beware - PHP, you can’t help but realize what a godawful PITA it all is. Switching to Docker enforces (or at least strongly encourages) a strict separation of (public) code and (personal) configuration. With this new setup, upgrading from one PHP version to another involves nothing more than changing a version number in a text file.
Website

Migrating from Blogger to Custom Domain on Wordpress Without Losing PageRank

Migrating from Blogger to Custom Domain on Wordpress Without Losing PageRank
Migrating a blog can be a very painful process, part of which stems from the fact that, if not done correctly, search engine valuation (aka PageRank) that took years to gain may be lost in days. Redirecting from the old blog to the new URL alleviates this problem at least, but not the way it is described on countless websites that recommend implementing JavaScript redirects search engines do not care about. Instead HTTP 301 redirects are needed which unfortunately required access to the .htaccess file on the web server hosting the old blog to set up. And you may have guessed already - Blogger.com does not grant that type of access.
Website

Latest Posts

Beautiful Slide Decks from Markdown: Presenting with Slidev

Beautiful Slide Decks from Markdown: Presenting with Slidev
Would you like to get away from PowerPoint and author slide decks in Markdown? Then Slidev may be just what you’re looking for. It’s a web app for presentations. The fact that it’s geared towards developers shouldn’t put you off. After all, who isn’t a developer these days, with AI? Slidev comes with the beautiful Tahta themes and supports features like syntax highlighting and animations. Export options to PDF and PPTX allow for easy sharing. This article shows how to get started.
Applications