Sometimes a site has been created in a WordPress Multisite network but needs to be moved to its own single site installation. There are a few scenarios where this might happen including:
In some instances you might find that you can move the site out of Multisite by using a plugin or a combination of plugins, but if this doesn't work you'll need to move the relevant database tables. Moving a site out of a Multisite Network in this way is a tricky process as it involves isolating the database tables in the Multisite database that relate to that specific site. However it's not impossible.
To follow this tutorial, you'll need:
Note: You can't move the main site out of a Multisite network, because the network won't work without it. If you do need to move the contents of the main site elsewhere, I would recommend creating a duplicate and then replacing the contents of the original site with a dummy site. You won't be able to move the domain name, though, as all of the other sites in your network are using it too.
If your site doesn't have a lot of configuration set up via plugin, theme or site settings screens, you may be able to successfully move it using the WordPress Importer plugin. If the site has widgets, you can copy their settings across using the Widget Settings Importer/Exporter plugin.
However, if you've added a lot of bespoke configuration using settings or options screens or the theme customizer, none of these will be copied across. In this case you'll need to do a manual move.
For full details of how to use these plugins to move your site, see my earlier tutorial on using plugins to move a WordPress site. The process is exactly the same for moving a site from a Multisite network to its own WordPress installation.
The site you're moving out of Multisite will have three components that you need to copy from the Multisite network:
Note: If your Multisite network was created prior to WordPress 3.5, you won't have a
sites folder. Instead you'll have a
blogs.dir folder in
wp-content with all of the upload files for the subsites. This will have a numbered folder for the site you're migrating, which you copy instead. I'll cover this in more detail below.
Before you start, think about the reasons you're migrating the site. Could it be purely to have a new domain name? If this is the case, then the free domain mapping plugin will let you give individual sites their own domain, and visitors will never see the domain of your Multisite network.
But if this isn't the only reason, then read on!
Before you do anything like this, it's a good idea to back up your Multisite installation. Use your preferred backup plugin, or a combination of FTP and phpMyAdmin if you prefer to work manually.
You'll use this backup to copy the relevant files to your new site, and it also gives you some peace of mind in case you have any problems.
Each site in a Multisite network has its own unique numerical ID. This is used to identify its folder in the
wp-content/uploads/sites directory (or
wp-content/blogs.dir if your Multisite network is older—see above), and also to identify the database tables for that site.
Find this by going to Network Admin > Sites and then selecting the Edit option for the site you're working with. The URL WordPress takes you to will give you the site's ID. The URL should be in the form
XX is the ID of your site, and will be the name of the folder containing its files, as well as the prefix for its database table names.
As you're only moving one child site and not the whole installation, you won't need the contents of your entire database.
In PhpMyAdmin, click on the Export tab. Then find the tables relating to the site you're exporting. They will begin with
XX is the ID of your site. An example is shown below.
Select all of the tables relating to your child site and then export them.
Note: WordPress Multisite stores all data relating to users of the network in the
wp_usermeta tables: it doesn't create separate ones for each site. If you have a lot of users on your site which you want to copy across from the network, then you might want to export those tables as well, import them to the new site and edit users in the admin screens to remove any that are not relevant to the new site. However, if your site just has one or two users, it's easier to recreate them on the new site. For more information on Multisite and database tables, see this tutorial on the WordPress database and Multisite.
Make a copy of the
sql file that's been downloaded to your machine and give it a name that tells you what it is (for example by adding
copy to its name). Open it in a code editor.
Change all instances of the site's domain in the Multisite network to its new single site domain. For example if your site was at
http://network.com/mysite, change it to to
http://mysite.com. If your network uses subdomains, you'll need to change all instances of
http://mysite.network.com. If you do this I'd advise also running a check for the subdirectory version just in case. Save your file.
Note: If your site had a domain mapped to it which isn't the domain you're moving it to, you'll need to replace that with the new domain too. Tread very carefully here, and keep backups!
The database tables in your new single site installation won't have prefixes for the site ID, so you'll need to remove these. In your
sql file, replace all instances of
XX is your site ID.
Now save the
In phpMyAdmin, create a new database in the location for your new site and install WordPress in the normal way.
Identify the plugins used by the child site and either install them in your new WordPress site via the Plugins screen or upload them from the backup you took of your old site.
Do the same for any themes your site is using—copy them from your backup to the
wp-content/themes directory of your new standalone WordPress installation, or just reinstall them.
Copy the uploads from your old site to the new one:
wp-content/uploads. Find the subfolder with your site's ID and upload its contents to the
wp-content/uploadsfolder in your new site.
blogs.dirfolder, that will also contain a folder with your site's ID. That will then have a subfolder called
files. Copy the contents of the
filesfolder to the
wp-content/uploadsfolder in your new site.
Note: you may need to delete any folders WordPress has created in your new
uploads folder to avoid any clashes.
Once you've done all this, activate any themes and plugins.
Now that you've installed your themes and plugins, you need to import the database tables.
Before you upload the tables from your old site, you'll need to delete the duplicate ones which WordPress has added to your new site.
In phpMyAdmin, drop the following tables from your database:
The screenshot shows my database with just those tables selected:
Select them, click on the With selected: dropdown box, and select Drop. When prompted, click Go.
Note: Don't delete the
wp_users tables, unless you've chosen to copy these across from the network as well (see above).
Next upload the database you've edited:
Clear your browser's cache. This avoids any problems you may have if the browser has cached content from the old site.
Now log in to the WordPress admin for the remote site. If you moved the user tables across, your login details will be the same as for your old site, but if you didn't, these will be whatever you specified when you installed WordPress in the new location.
Visit the Permalinks screen and turn pretty permalinks back on.
Check that all your links are working ok and that widgets and plugins are behaving as they should. If not, you can either step back through the process, using your backups where you need to, or simply set up the plugins and widgets from within your new site.
Once you are completely happy that everything's working as it should, remove the site from your Multisite installation. I'd recommend leaving this a week or so in case you spot anything that hasn't moved across. In the meantime, you can configure the old site's domain to map to the new one, either by using a plugin or in CPanel.
Phew! It was a long and slightly complicated process, but you've done it.
Migrating a site out of WordPress Multisite and into its own installation isn't something you can do quickly or without being very thorough, but it is possible and I've done it a few times. If you follow the steps above and make sure you have backups in case of any problems, then you should find it works smoothly for you.