Get The One-Man Army For Running Your Multiple WordPress Sites
December 26, 2018 Hardik Shah

Are you having trouble maintaining the balance while juggling your multiple WordPress sites? We bet, it might be super-hectic, isn’t it? But why are you putting yourself under so much pressure when one simple thing can release you from all that? Wondering about whom and what are we talking about? Scroll below.

Introducing WordPress Multisite Network Migration!

A one single, simple, and super solution to multiple worries, the WordPress multisite network allows you to run and manage multiple WordPress sites from a single and same WordPress installation. Take, for instance, the one and only “WordPress.com” which is the biggest example of a multi-site network itself, running thousands of sites within the same WordPress.

Our client approached us for a migration process to which we carried out the following to ensure they get what they wanted in the end. At first, we confirmed under which scenario are they willing the migration to take place. We explained to them that; always redirect the viewer to the old URL. To fix this issue we searched for the below two lines in their wp-config.php file and migrated them to their correct URL;

define(‘WP_HOME’, http://my-domain.com’);


define(‘WP_SITEURL’, ‘http://my-domain.com’);


These two statements made the WordPress ignore the values in the database and use the home and site URL values that were specified in the wp-config.php file.

WordPress Multisite Migration is done under three scenarios;

  1. Migration of a single website into an already existing WordPress Multisite Network.
  2. Migration of a single website out of the WordPress Multisite Network.
  3. Migration of the entire WordPress Multisite network from one domain to another website.

Once that was clear, we moved on to the next step where it is necessary to understand why one wants to migrate? WordPress Multisite Network Migration is done for the following websites where multiple things like sections, departments, domains etc. are to be managed like;

  1. A magazine website with different sections managed by different teams.
  2. A business website with sub-sites for different locations and branches.
  3. Government or non-profit websites having different departments, locations, and regions.
  4. Your personal network of blogs running on multiple subdomains.
  5. Schools and colleges allowing students to create their own blogs on school servers

Now comes the picture how we helped them migrate

1. Export/Import of WordPress Database We started the migration process by first moving the contents from their current host to a whole new server, for which, we used the best option MySQL and exported all the data

  • irectly through its commands. [Note: If you have SSH access to your servers you can use the command mysqldump to export the data as well.]
  • Next, we exported a SQL file from their database doing the following;

mysqldump -uUSER -pPASSWORD DBNAME > export.sql

And imported a SQL file to the database doing the following;

mysql –uUSER –pPASSWORD DBNAME < export.sql

By changing the USER, PASSWORD, and DBNAME to the right values in their installation.  [Note: In case you don’t remember the credentials of the same, open your wp-config.php file (when you have access to it) and you’ll find them there.]

2. Files, Plugins, and Themes Transfer

  • Since their database was all set, it was the time to transfer the files stored in their old WordPress host to the new one, which basically means copying all the contents of the following folders:

wp-content/themes – The folder where all the WordPress themes are stored. Since the client didn’t want to switch to a new theme, we just copied all of the contents to this folder.

wp-content/plugins – The folder that contains all the WordPress plugins. Again, we copied all the contents to the new host. As the plugin configurations are stored in the WordPress database, after importing the SQL file in the previous steps, we confirmed whether everything is working perfectly in their new host or not.

wp-content/uploads – The folder where all the media files that appear in the Media Library are located. The size of their folder appeared to be huge due to a lot of images on their site.

3. WordPress Configuration after Migration

After the transferring process, we reached the crux of the whole migration process which is often a bit tricky part.

  • Every database has a lot of references to the old site. While migrating, if by chance one changes the domain name while trying to access the new WordPress site after importing the database file, it will result in several redirection problems. The reason this happens is that the WordPress thinks that it is located in the old server with the old domain.

We solved these wrong URL address problems by doing the following;
For starters, we informed WordPress that the site’s location has changed because or else if WordPress sees that the current URL is not the URL of the new domain, it will always redirect the viewer to the old URL. To fix this issue we searched for the below two lines in their wp-config.php file and migrated them to their correct URL;

define(‘WP_HOME’, http://my-domain.com’);


define(‘WP_SITEURL’, ‘http://my-domain.com’);


These two statements made the WordPress ignore the values in the database and use the home and site URL values that were specified in the wp-config.php file.

Updating of URLs in Posts and Custom Fields

  • We updated all the posts and custom fields that included the old URL with the URL of the new domain while changing the domain name.
  • We updated all the posts and custom fields that included the old URL with the URL of the new domain while changing the domain name.
  • To fix this, we opened their phpMyAdmin and accessed their WordPress database.
  • Before jumping to the next step, we have made the backup of their database using the export function described before.

Conclusion

This is all that we did to migrate their WordPress Multisite Network safely and quickly. And to be very frank, we were more excited and happier, then our customer itself due to the kind of challenge we overcame together

We at WPOnlineSupport specialize in a variety of WordPress Services, WordPress Plugins, WordPress Themes and Pro Support For a free inquiry please contact us.