How to move WordPress Multi-site installs

OK, when you move a single WordPress site, you only need to make two changes in the database to inform the installation of the change of URL.

However, when you change a multisite site, there are a few more changes you need to make….

I am going to work through the steps one by one.

No Changes – what happens

Note: This site is on a local test server, but still behaves like any other.

if you have transferred over your web site and not make any changes, then the WordPress will try and launch back on the old domain name. This could then allow you to see the old site, on its old hosting, or, as in the case of my example, I find an error from BT, as it tries to launch a now unknown domain. (BT is my ISP and launches instead of the usually expected google)

Change the wp_config file

Unlike single site installations, multisite adds content to the wp_config file.

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', '');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

So, you need to update the DOMAIN_CURRENT_SITE to the base domain of the multisite.

You may now see an error in database connection. Don’t worry, we can fix this.

I refer to all your database tables as wp_xx. You should have changed the default wp_ to something else.

Update wp_site database table

You need to update wp_site, which has one entry, with the new full URL.

Update wp_options database table

You need to update wp_options.
Both the home and siteurl need to be set to the main URL

Update wp_blogs database table

In wp_blogs all the entries need the domain column changed to the new domain. (note there is no ‘http:/’  in this entry.)

Now the main site works?

You should now be able to see the main site!

Update wp_2_options database table

Lastly you just need to go to all the wp_options_2, wp_options_3… database tables and update the siteurl and home entries to the url for each web site.