Moving the domain of a Wordpress Multisite Install
In case you’re looking to move a WordPress site with Multisite and not sure where to start, hopefully the notes below will save you a bit of time. If you’re looking to move a regular site, then check out this page here: http://codex.wordpress.org/Changing_The_Site_URL
In a Multisite install, the domain and path get populated more times in the database, so it just requires a few more tweaks to get up and running.
To move your site:
- TAKE A FILE & DATABASE BACKUP!
- Transfer all web files and the the database to the new server
- wp-config.php – Open your config file and update the database connection and the fields:
$base = '/'; define( 'DOMAIN_CURRENT_SITE', 'mydomain.com' ); define( 'PATH_CURRENT_SITE', '/' );
- .htaccess – Open your .htaccess file and confirm or update the line: RewriteBase /
- Login to your PHPMyAdmin and open the database
- Open table ‘wp_options’ and adjust the fields ‘site_url’ and ‘home’
- Open table ‘wp_blogs’ and adjust the domain and path for all entries
- Open table ‘wp_site’ and adjust the domain and path
- Open table ‘wp_sitemeta’ and adjust the field ‘site_url’
- WordPress Multisite stores the standard WordPress tables for each blog with the incrementing prefix e.g. wp_1_ , wp_2_, wp_3_ … so you need to open up the ‘wp_*_options’ table for each and adjust the fields ‘site_url’ and ‘home’
- TAKE A DATABASE BACKUP!
- We then need to run a SQL command to update the GUID for each of the blogs incrementing the table as before:
UPDATE wp_posts SET guid = REPLACE (guid, 'http://exampleoldsiteurl.com', 'http://examplenewsiteurl.com');
- Repeat the above and replace ‘guid’ with ‘post_content’.
- Run your site
You should now be ready to roll. If you get a connection message, then it is likely some paths are still not correct… if you get a white screen, then you’re best bet is to check your active templates are all in place.