One of the most frequent questions I've been asked by students completing the WordPress Multisite course in The Academy is this: how do you move an existing WordPress site into a Multisite network?
This post is designed to answer that question and take you through the steps you need to follow to move a site into a network. I'll look at:
- How to use the Import/Export tool to migrate content.
- How to use the Widget Settings plugin to migrate widgets.
- How to tidy up afterwards.
Choosing a Migration Method
In this post I'm going to show you the easy way to migrate your site, using a couple of plugins. This has the advantage of being quick and easy, and for most sites it will migrate almost everything you need.
But if you've made a lot of customizations to your site using the Customizer, or you've spent a lot of time setting up your plugins, this method won't migrate all of that. You can either take the time to manually tweak everything again (see the final part of this post) or you can manually migrate the site by copying the relevant database tables.
Migrating the database tables involves using phpMyAdmin to download database tables, editing the resulting sql file and re-uploading that using phpMyAdmin again. It saves you having to do any tidying up at the end but can be a bit daunting. I'll cover that in a separate post – if you don't feel up to that, by all means follow the instructions here.
So let's get started!
Before You Start
But wait. Before you start, there's a very important thing you need to do. Back up your sites. Make a backup of the site you want to move AND your network. Just in case. Use your favorite backup plugin (it's Snapshot Pro, right?).
Ready? Now you can get started.
Exporting Content from the Old Site
WordPress provides a tool you can use to easily import and export your content. Let's start with that. Open up your starting site. Here's mine:

In the admin screens, go to Tools > Export:

Unless you just want to export certain post types, keep the All content option selected and click the Download Export File button. WordPress will create an XML file and download it to your computer.
Creating a New Site in Your Network
Now open the network into which you want to import your site. Start by creating a new site in the normal way.
Installing and Activating Plugins and Themes
Before you import content, install the same theme you were using in the old site on your network and activate it for your new site. Do the same for any plugins.
If you're not sure how to install and activate themes and plugins on your network, see our guide to configuring Multisite.
Importing Content to Your New Site
Now, before you import the content from your old site, go into the Posts and Pages listings in the admin screens and delete any dummy content that's been created for you when you created the site. Delete any widgets too. You should have an empty site.
Before you can import the content from your old site, you'll need to install the WordPress Importer plugin. Go to your Plugins screen in the network admin and install that (you'll need to search for WordPress Importer).
Now in your new site's admin screens, go to Tools > Import and scroll down to WordPress at the bottom of the list. Click the Run Importer link.
WordPress will ask you to select a file to upload:

Click the Choose File button and then select the file from your machine (it will be in your downloads folder unless you've moved it). Remember you're looking for an XML file. Once you've done that, click the Upload file and import button.
The importer now wants to know if you want to assign content to existing authors on your network, or import authors:

Select whichever option applies to you. I'm assigning my posts to my existing username, but if you're running a multi-author site you may need to import authors.
Finally, select the Download and import file attachments option to copy media files from your old site and insert them in the correct place in your new one. This is one of the most useful features of the importer as far as I'm concerned and I've never yet come across a site where I didn't check that box!
Click Submit and the importer will work its magic.
Eventually you'll see the All done! message. Take a look at your Posts admin screen to see the posts that have been imported: you'll find pages too.
So that's your content imported. Next, let's import widgets. You can do this with another plugin.
No comments:
Post a Comment