Migrate a WordPress blog from a multisite network to an individual installation

Sometimes we need to extract a WordPress blog from a multisite network in order to give it a clean, standalone installation. This happens in particular when the blog in question requires too much customization, it no longer fits into your multisite network, or simply because you want to pass it on or sell it to someone.

If it is possible to migrate the blog with the WordPress export/import tool, this solution will not allow you to recover the database, theme customizations, images, etc. Therefore, with a simple import / export, you will have to set everything up again.

I therefore offer you a short guide to do it manually and properly, so as to truly migrate your site from A to Z without losing a bit of it.

Don't miss business advice by email

No spam, just an email when new content is published.

Back up your Multisite network

There are many WordPress backup plugins. Choose the one that suits you best to back up your entire network.

Additionally, manually back up your network by uploading everything on your server via FTP and uploading a backup of your database to phpMyAdmin.

 

Export your WordPress site

Find the ID of the blog you want to extract

Before you can extract your database, you need to know the ID of your child site, since the site you want to migrate is part of a site set. Go to “My Sites > Network Admin > Dashboard”, and the ID of each site is displayed in the “ID” column or by clicking on it in the URL displayed on your address bar.

find-id-multisite-wordpress

 

Export only the tables linked to the WordPress site you want to migrate

To do this, go to PhpMyAdmin (your host must be able to give you a link and the credentials to access it).

  • Click on “Export”
  • Export method: custom
  • Select only the tables containing your ID.
  • If you have a large number of users linked specifically to the WordPress site you want to extract, select the tables as well wp_users And wp_usermeta. Otherwise, I advise you to recreate your few users manually on your newly created installation.
  • Finally, click “Run”.

An SQL file has normally been downloaded to your computer. Carefully copy it to a new folder, and rename it by adding “copy” to its name, in order to isolate it.

 

Export the settings of your theme and plugins

If your theme allows you to save your settings, as well as certain plugins, remember to do so in order to re-import them if necessary in the new installation.

 

Edit your SQL file to adapt it to the future installation

Open the copied backup file with your favorite editor (Notepad++ for example). Do a search for your network's domain name, and replace all occurrences with your future domain name.

  • If your child site was in a subdirectory, replace all http://monsite.monreseau.com with http://monsite.com
  • If the URLs of your child sites were in this form: http://network.com/mysite, replace all these URLs with “http://mysite.com”

Next, replace the database prefix with an individual blog prefix:

  • Replace all wp_XX_ (where XX is your site ID) by wp_ because your new database will be individual, and the tables will be in the form wp_ and above with your ID.

Finally, during your various plugin or theme settings, you may have entered absolute URLS referring to the /wp-content/uploads/sites/XX folder, where XX is the ID of your site, and which corresponds to the media folder of a child site contained in a multisite network. You need to correct this:

  • Replace all /sites/12/ by /

Save the file.

 

Migrate your site to a new individual installation

If you haven't already done so, create a new "single" installation of WordPress, where you want to transfer the site extracted from your network. Your host will provide you with the FTP credentials to connect to the new installation.

Upload downloaded files from FTP

Remember, in step 1, you downloaded your entire network of sites from FTP. All your files are therefore safe. We will therefore select from this backup the files that you need to reupload on the new installation, namely:

a) WordPress plugins used on your extracted site

  • Go to the plugins page of your WordPress admin to list the activated plugins that you are using on your site.
  • Also go to your network's extensions page to list the plugins activated by default across your entire network!
  • Upload the extensions you need from the two lists above. These are the plugins currently used on your child site, which you would normally need to duplicate on your new site. On the other hand, do not take into account plugins exclusively created for multisite (like domain mapping plugins for example), which will be of no use to you in individual installation.

b) Themes linked to your exported site

Reupload to your new installation all the themes potentially used on your child site, and particularly the active theme of your site. Themes are located in the /wp-content/themes folder.

c) Media linked to the site to be migrated

You have transferred the plugins and themes, you still have the photos. Go to /wp-content/uploads/sites/XX, where XX is your site ID. Upload all the files and folders there, to the /wp-content/uploads folder in your new installation. Make sure the /uploads/ folder of your new install is blank.

If the /uploads/ folder does not yet exist in your new install, create it and give it a CHMOD of 755.

Your blog now contains both the media, but also the theme and plugin files of your source site. It now remains to transfer the database, which contains all the settings and content of the site that you wish to extract.

Import the database

Go to the phpMyAdmin of your new WordPress installation (the individual install), in order to delete certain tables that you are going to import anyway. This is to avoid creating unnecessary duplicates.

Here are the tables that need to be deleted:

  • wp_commentmeta
  • wp_comments
  • wp_links
  • wp_options
  • wp_postmeta
  • wp_posts
  • wp_terms
  • wp_term_relationships
  • wp_term_taxonomy

If you had chosen to export the tables wp_usermeta And wp_users, also delete them before importing.

To delete these tables, click on your database on the left, select them, and from the drop-down menu at the bottom, choose "Delete".

Then click “Import”, then import the SQL file you edited before. After that, it's finished, your site has been transferred from a multisite to an individual installation!

End Settings

Check that everything is OK. Normally, the domain name continues to point to your old server, that of your multisite network, but you can consult your newly created blog from a URL provided by your host, for example "myblog.wpengine.com" if your blog is hosted at WP Engine.

If some images don't load, check their path; if their URL points to a URL like this: monsite.com/wp-content/uploads/2015/01/mon-image.jpg, it’s a good sign. Check in the directory in question, via your FTP, that the image exists, therefore that it has been uploaded to the right place. If so, it will appear when you update your blog URL and your domain name DNS.

If your theme has its default settings, import the options from the old blog via the theme import tool, generally offered for premium themes. Same for certain plugins.

If after that, everything seems OK on the newly created site, you should normally:

  • Update the DNS of the domain name so that it points to the new server. Your host must give you the information to do this.
  • In the admin of your host (the one hosting your new installation), you generally need to enter the domain name used for this new installation.
  • In the general WordPress settings, update the URL of the new site, replacing the WordPress web address URL and the site web address.

After that, your domain name should point to the new installation. Consider deleting or deactivating the child site located in your multisite network, but only after a few days or weeks, in order to keep it as a backup just in case.

One Response

  1. Very good article, this is what I was looking for!
    On the other hand, I do not have the display of subsites on the page in super-admin as indicated?
    I suppose it's similar if we migrate a subsite from a multisite to another, except that we have to replace the prefix "oldprefix_wp_XX" with "newprefix_wp_YY" because I only have one hosting with one single DB but multiple domains that point to different directories.
    Cdlt,

Leave a Reply

Your email address will not be published. Required fields are marked *

Don't miss business advice by email

No spam, just an email when new content is published.

en_USEN