The Thorough Way to Move a Site Into a Multisite Network
The Thorough Way to Move a Site Into a Multisite Network
In a recent post, I demonstrated the easy way to move a WordPress site into a Multisite network, using plugins. For many sites, this method works perfectly fine. But what if your site’s settings are a bit more complex?
If you move your site using plugins, you’ll be able to move two things: your content (posts, pages, custom post types, menus – all of your content) and widgets. But what it doesn’t let you move is the settings for your site. If you’ve got some heavy plugins installed (like an e-commerce plugin) or you’ve made lots of tweaks to your site’s settings, you;’ll then have to go into the admin screens for your new site and set those up manually, copying what you did for your old site.
This can be a pain. It takes time and it’s not entirely reliable. What if you miss something important? If your site has a lot of settings, it’s not easy to make sure you’ve caught everything.
So in this post, I’m going to show you a more thorough and reliable way to move your site into your Multisite network.
Moving Your Site Manually – an Overview
This involves 6 steps, many of which are the same as if you’d just used plugins:
- Create the new (empty) site in your network.
- Create a copy of your old site’s wp_options database table and edit it.
- Create a copy of your old site’s themes and plugins and upload them to your network’s wp-content directory.
- Run an export and import of your content and users.
- Import the database table you’ve edited to your new site.
- Run an export of your old site’s widget settings and import them to your new site.
That’s quite a lot of steps, and it’s not something you should undertake lightly. It requires being comfortable uploading files and database tables manually.
Note: If you’re used to moving a single site from one place to another manually, you might think that this process is very long winded. That’s because of the way Multisite stores user data. With a single site, we could simply copy all of the content and database tables from the one site and import them into the second site. But with Multisite the users are stored once for the entire network, not individually for each site. This means that if you want to import your users from your old site to the new one and assign the correct content to them, you’ll need to use the importer tool.
What You’ll Need
To follow along with this post you’ll need these tools:.
- An FTP client such as FileZilla or a code editor with FTP built in, such as Coda.
- Access to your sites’ databases via phpMyAdmin, a tool which your hosting provider should give you access to.
So let’s get started!
Before You Start – Backing Up
Before you do anything, make a backup of your Multisite network. Don’t skip this step – if anything goes wrong, you’ll need a backup to reinstate. I recommend using our Snapshot Pro plugin to do this.
Creating a New Site in Your Network
Create a new site in your Multisite network in the normal way. Once you’ve done this make a note of its ID: Multisite gives each site in a network a unique numerical ID. You can find this by going to the Sites screen in your network admin screens, finding the new site and clicking Edit.
This will open the editing screen for your new site:
In your browser check the URL for this screen. The site’s ID will be the final two digits at the end of the URL. Make a note of that.
Copying Your Themes and Plugins
The first step is to make a copy of your old site’s themes and plugins as well as the wp_options table from the database. Let’s start with the themes, plugins and uploads.
Here’s my starting site:
Downloading Themes and Plugins
Open your FTP program or code editor, and navigate to the wp-content directory in the site you want to move (which I’ll refer to as your old site). Download a copy of these folders:
Save these to your local machine somewhere you can find them easily – I always set up a dedicated folder when I’m doing this.
Uploading Themes and Plugins to the Network
Now you need to upload the themes and plugins you copied from your old site to your network.
Find the wp-content directory in your network and open each of the themes and plugins folders in turn.
Upload the file or folder for each theme and plugin to the correct directory. If any of the plugins or theme from your old site are already installed in the network, you don’t need to upload them again.
Note: If you’d rather not do this manually, you can just install the relevant themes and plugins in your network. I prefer to do it manually as it’s quicker. If you do take this route, you don’t need to activate the themes and plugins – that will happen automatically once you’ve imported the database table.
We are the Multisite Experts. Period.
We’ve been developing plugins for WordPress Multisite for the past 10 years. With WPMU DEV you get our most popular plugins like Domain Mapping, Snapshot, Pro Sites, Support System, User Switching and bucket loads of others tailored specifically for Multisite! Woop!TRY OUR MULTISITE PLUGINS FREE LEARN MORE
Copying and Editing the
My preferred way to export the database table is by using phpMyAdmin. You’ll need to use this for importing the table to the new site anyway so you may as well start now.
Exporting the Table
In your hosting provider’s admin screens for your old site, go to phpMyAdmin and find the database that’s running your old site.
Note: If you’ve got more than one database running, you can find out which one is behind the site you want to migrate by checking that site’s wp-config.php file.
Find the wp_options table and select it:
Now scroll down and find the With selected: drop-down list. Select Export. When prompted click the Go button.
This will download an SQL file to your local machine. Copy that to the folder you’ve created to keep your files.
Editing the SQL File
Open the SQL file that you’ve downloaded. Using your FTP editor, select the Find & Replace option (in many editors it’s Ctrl-F or Cmd-F).
1.6 million WordPress Superheroes read and trust our blog. Join them and get daily posts delivered to your inbox - free!
In the Find field type wp_, and in the replace field type wp_XX_, where XX is the two digit ID of your new site in the network. (in my case it’s wp_71_, I’ve got a lot of sites in my network!)
Click the All button if your code editor has one, or Replace all if that’s what your program gives you. Wait for the program to run the replace.
Now repeat this step for your site’s URL. In the Find field, type the URL for your old site and in the Replace field type the URL for your new site. Make sure that any backslashes are consistent. I prefer to miss out any http:// or www and just use the root URL, e.g rachelmccollin.com.
Note: If you’ll be redirecting your old domain name to your new site using domain mapping, don’t worry about this yet. You’ll set up domain mapping once you’ve migrated your site. For now use the URL generated by your network.
Save the file and close it.
Exporting and Importing Content
The next step is to use the WordPress importer tool to export the content from your old site and import it to your new one.
Exporting Content from the Old Site
In the admin screens for your old site, 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. Save it in the folder you’ve created for your working files.
Importing Content to the New Site
Before you import the content from your old site, delete any dummy content that’s been created for you when you created the 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.
Next, you’ll be prompted 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 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.
Click Submit and the importer will import the content, after which you’ll see the All done! message.
Note: this only imports those users who have content assigned to them. If you have other users on your site, such as subscribers, you’ll need to import them separately. You can use the Cimy User Manager plugin to do this.
Importing the Table to your Network’s Database
Now you need to import the wp_options table for your site into the database for your network. It’s important that you do this after uploading themes and plugins as many of these settings will relate to those themes and plugins.
Open phpMyAdmin for your network. Find the wp_options table for your new site (in my case it’s wp_71_options) and select it:
Scroll down and select Drop in the With selected drop-down list. When prompted, click the Yes button.
Now click the Import tab at the top of the phpMyAdmin screen to view the import screen:
Click the Choose file button and select the SQL file that you’ve edited. Then click the Go button.
The import will run and you’ll see a screen telling you it’s been successful:
Importing Widget Settings
The last thing to import from your old site is your widget settings.
Exporting Widgets from Your Old Site
Go to the admin screens for your old site and install and activate the widget settings plugin there too. Go to Tools > Widget Settings Export to see the exporter screen:
Unless you just want to select some of the widgets from your old site (and not all of them), select the Select All Active Widgets checkbox. Click the Export Widget Settings button to download the export file. This will be called widget_data.json.
Importing Widgets into Your New Site
Now switch to your new site, and go to Tools > Widget Settings Import:
Click the Select a file button and find the file where you downloaded it. Note that you’re looking for a son file this time, not an XML file. Then click the Show widget settings button to see the widgets in the file:
Select the widgets you want to import, or just click on the Select All Active Widgets button, and make sure the Clear Current Widgets Before Import button is selected. Then click the Import Widget Settings button.
That’s it! Your content, authors, and widgets are all imported, as well as your settings.
Moving Your Site In This Way Takes Longer but is More Thorough
You’ve now moved everything across. You’ve followed a fair few steps and used a mix of plugins and manual imports and uploads, but you’ll now find that you don’t need to make any tweaks to your site’s settings. Here’s my new site:
If your site has lots of installed plugins, customizations and settings configured, you’ll find this method is more reliable and in the long run saves you time. Just make sure you take that backup at the beginning (just in case) and that you follow each step in the correct order.