Migrate WordPress MultiSite

WordPress Multisite migration is not too easy to achieve though it’s not impossible too. A Multi-Site is referred to as a Sub-site under your primary site.  These subsites will have the same user base as your primary website, but the domain or the site’s path may be different. Also, these sites could have completely different layouts and styles as per your preference. A multisite is also known as a Sub-Directory or a Sub-domain, both of these sites work the same. It entirely depends on your needs.

A Sub-Directory will have the URL path as www.your-domain-name.com/sub-site-name, whereas, a Sub-Domain site’s URL will be like sub-domain-name.your-domain-name.com. But, there could be a possibility that a user may want to migrate and change its primary domain name. It is only possible to buy a new one. So, in this case, he would have to migrate all the user’s data and WordPress tables to his new domain.

In this article, we are going to see how actually we migrate our Multi-Site to another domain. So, let’s get started.

  1. Copy/Upload WordPress Folder
  2. Connect Database
  3. Edit wp-config & htaccess Files
  4. Export/Import Database
  5. Edit Database Tables

#1 Copy/Upload WordPress Folder

To start the migration process, the user must have to copy the Core WordPress Installation folder and upload it to the new domain hosting through an FTP Client. This will replicate your themes and plugins installed in your WordPress Multi-Site. If you have already WordPress Installed then you can also choose to select the wp-content folder and wp-config and .htaccess files only.

#2 Connect Database

Just as the Normal WordPress Installation, you would have to change the database name and password, for a successful connection. To edit the database name and password, follow the given steps:

  • After you upload the Core WordPress folder, open wp-config file for editing through your hosting file editor.
  • Now, here you can edit the following line of code with the appropriate data.
/** The name of the database for WordPress */
define( 'DB_NAME', 'database-name-here' );

/** MySQL database username */
define( 'DB_USER', 'hosting-username-here' );

/** MySQL database password */
define( 'DB_PASSWORD', 'hosting-password-here' );

/** MySQL hostname */
define( 'DB_HOST', 'host-name-here' );

#3 Edit wp-config & .htaccess Files

Your new website will still not work yet because the use of wp-config file is not ended yet. You still have to add some code to it along within .htaccess file too. These codes will make your normal site to a multisite and will add some Multi-Site Read/Write rules to it. To get these codes, login to your old Multi-Site Admin Dashboard and navigate to wp-admin > Network Admin Dashboard > Settings > Network Setup.

Migrate WordPress MultiSite
Migrate WordPress MultiSite

Do as the steps mentioned. Add/Replace the codes in wp-config and .htaccess files respectively in your new Domain files.

#4 Export/Import Database

You will also need to export your database to your new domain. To do so, login to your old domain hosting manager and proceed to login PHPMyAdmin. Select your database which you want to export.

There should be an export option on the top navigation bar. Clicking on it will download a zip file of your database. The size of the zip file will, of course, depends on the size of your database.

Now login to your new hosting domain, and get to its PHPMyAdmin database manager. At the top, you would again see the import option. Click on it and carry on with the steps mentioned. Importing and Exporting the database should not need you to change any option. We most often leave them as default and you should successfully be able to Export/Import the Database.

Migrate WordPress MultiSite
Migrate WordPress MultiSite

NOTE: Make sure that your database’s name will match with the name you mentioned in your wp-config file. Also, if you have already WordPress Installed then the cleanest way to migrate is to delete all of your new database’s data and then import the old tables data.

#5 Edit Database Tables

We are almost done, the last thing that we have to do is to change some database tables. The database which you have imported will have the data pointing for your old domain, so you would have to point those tables to your new domain. Otherwise, your website will not connect to the database as these tables are essential for your WordPress Installation.

You just have to replace the old domain name with your new domain name. Same goes for every subsite you have created. To do so, you would have to navigate to your hosting’s PHPMyAdmin and change the following tables in your Database:

  • wp_blogs
  • wp_options
  • wp_site
  • wp_sitemeta

Above are the most important tables that must be changed to make your site work. You just have to change domain, site_url, path, home, etc., in the above tables. It’s not necessary that you will find all these options to change in every table, just make sure to change these wherever you find these from the mentioned tables.

sub domain

Also, every sub-site you have created will have their own WordPress tables added with a sequential numbered prefix. For example, your first sub-site or sub-domain will have tables like wp_2_blogs, wp_2_options, wp_2_site, wp_2_sitemeta, etc and so on for your corresponding numbers of sub-sites. So, make sure that you will change the value in those too.

Migrate WordPress MultiSite

There could be a number of sub-sites, so it could be hectic to change all of these values yourself. So, there is a script called Database Search and Replace Script in PHP which you can use to find and replace your old domain names and paths with your new ones.

Final Words on Migrate WordPress MultiSite

We hope that we have helped you in migrating your site to a new domain, saving you from getting a fresh start. There are a couple of options to change for site-migration but if you have followed us step-by-step then we hope that there would be no errors thrown at your way.

If you have any questions regarding this Multi-Site migration process, then feel free to ask in the comment section below. Thanks for Reading!

Interesting Reads:

WordPress Community Plugins

Useful Content Promotion Platforms And Tools

Best Practices for eCommerce Web Design

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.