I’ve had to do this a few times, where I’ve had to move a WordPress multisite site to a standalone installation. For example, I sometimes build new sites on my own multisite network, if the client already has a live site, where downtime is not an option, and then I can move the entire site onto their server and make an immediate switch to their new site.
The process to do this is a bit fiddly, and there’s no plugins (other than BackupBuddy) or built-in functionality that can achieve it, so you’re stuck with doing it manually. Here’s how to do it:
Copying the existing site
There are several elements from the existing site that you’ll need to make copies of. First of all, find your site ID – you’ll need this in a number of the steps below. To do so, do to /wp-admin/network/sites.php and rollover the link of the site you want to copy. The destination URL will end with a query var, like ?id=12. This is your site ID (12 in this case). Remember it.
Open up phpMyAdmin and open up your WordPress database. Click on the export button and select all tables that are prefixed with wp_ID_. Also select wp_users and wp_usermeta. The tables might have a prefix other than wp_ if you changed it for security reasons.
Export the tables to a SQL file and save it locally on your machine. Now open it up for editing in a plain text editor, like TextEdit, or Notepad. Search for the following strings in the file and replace them as shown below:
- Search for the old domain name and replace it with the new one. For example, replace testsite.theukedge.com with mynewdomain.com in every instance.
- Search for incorrect file locations. Replace the string yournewdomain.com/files/ and replace it with yournewdomain.com/wp-content/uploads/
- Search for the word files, and where it references an upload location, change it to wp-content/uploads
- Search for your old table prefix (like wp_ID_) and replace it with whatever your new one will be. The more random it is, the better, for security reasons. Also search for wp_users and wp_usermeta and change them to the same prefix.
Save the file – it’s now ready for your new site. However, that’s just the database, there’s more to copy yet.
Login to the site using FTP and navigate to wp-content/plugins. Copy all of the plugins that are active on the site to your computer. Now move to wp-content/themes and copy any themes that need to be copied to the new site. Finally, go to wp-content/blogs.dir/ID/files and copy the entire contents to your hard drive.
Now you have everything you need to upload to the new site.
Upload it to the new site
Upload WordPress to the new server and configure wp-config.php with the nonces and salts, database information and your database prefix from above. This will require setting up a database and database user if you haven’t already. Save the file.
Now, navigate to wp-content/themes and upload all the themes that you copied from the old site. Go to wp-content/plugins and do the same with the plugins you copied. Finally, go to wp-content/uploads (you may need to create this directory) and upload everything that came from the old wp-content/blogs.dir/ID/files directory.
Once everything’s finished uploading, log in to phpMyAdmin on the new server and navigate to the database, which should be empty. Click on import and import the SQL file that you edited and saved to your computer. Once uploaded, you should see 11 tables (plus any extra tables created by plugins) in your database.
You are now set to try out your new site. Navigate to your site and check that it loads correctly – be sure to check a lot of your pages, particularly ones where plugins interact with them (such as contact forms, or slideshows). Then try logging in and make sure that you can navigate the backend correctly.
Now your old Multisite site is its very own WordPress site that you can hand off to a client.
Did you manage to get through this? Are you stuck and need help? Let me know how it went in the comments.