We create beautiful & user-friendly websites and provide quality web development services worldwide.
Contact us to get started on your project.

Tutorial

How to Move a Website from a WordPress Multisite Network to Its Own Standalone Site

Published by Veron Ang | Leave a comment


WordPress offers the very powerful Multisite Network feature, which makes it possible to run multiple websites on one single WordPress installation. But there may come a point in time when you need to move a website out from a network to its own standalone site, for instance, when migrating a networked site to a different server. Some people may be put off by this process as it seems impossible to change the configuration. I had to do this recently, and successfully migrated a site out of the network onto its own standalone WordPress installation with its own database.

The process is a technical one, but not that complex. Just remember to backup your database so that you can easily restore it if something goes wrong. Here are the steps I took.

Moving a WordPress site from Multisite Network to Standalone Installation

On the old server/database:

  1. In phpMyAdmin (or whichever SQL client you are using), export all tables used by the site as an SQL file. Minimally this should comprise the following:
    – Tables with the prefix of wp_#_* (where # is the number corresponding to the site you are moving). If your site is housed in tables wp_2_*, you should be exporting these tables only.
    wp_users
    wp_usermeta
  2. Open the exported SQL file in a text editor.
  3. Find and replace all instances of wp_x_ with wp_ .
  4. Find and replace all instances of /files/ with /wp-content/uploads/.
  5. Save the file. Your edited SQL file now has the necessary tables for a standalone WordPress site.
  6. In a FTP client, download all the Media files that have been uploaded to the site. These files reside in the folder wp-content/blogs.dir/#/files (where # is the number corresponding to the site you are moving).

You should now have the edited SQL file and the Media files. We will need to move these to the new server.

On the new server/database:

  1. Run a fresh installation of WordPress. You should have a brand new, working WordPress site with the “Hello World” blog post.
  2. In phpMyAdmin, import the SQL file you have earlier edited. This will import all the WordPress content from your previous site.
  3. Run this SQL query:
    UPDATE wp_posts SET post_content = REPLACE(post_content, '/files/', '/wp-content/uploads/');
  4. If you have changed your URL, run this SQL query:
    UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://olddomain.com', 'http://newdomain.com');
  5. Browse the wp_options table.
  6. Under the field option_name, scroll down and look for upload_path. Change the option_value from wp-content/blogs.dir/#/files to wp-content/uploads.
  7. Under the field option_name, scroll down and look for fileupload_url. Change the option_value from http://olddomain.com/files to http://newdomain.com/wp-content/uploads.
  8. If you have changed your URL, under the field option_name, scroll down and look for siteurl. Change the option_value from your old URL to the new URL.
  9. In a FTP client, upload all the Media files to wp-content/uploads folder.

You should now have your site running on its own WordPress installation, with all the content and files from the formerly networked site.

While these steps are taken to move a site from server to server, they will similarly work for moving a site from one database to another within the same server.


About the Author

Veron Ang is a , developer and WordPress expert at Sparklette Studio. She graduated with a bachelor's degree in computer science from the National University of Singapore. Engage her to work on your next project by sending her a message from the contact page or on Twitter.



Leave a comment