Skip to content

Instantly share code, notes, and snippets.

@chrisdigital
Created May 1, 2013 05:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisdigital/5493911 to your computer and use it in GitHub Desktop.
Save chrisdigital/5493911 to your computer and use it in GitHub Desktop.
Moving WordPress multisite to a new domain (example shown copies production to development environment.)
//http://wordpress.org/support/topic/transfer-multisite-to-another-server
//http://halfelf.org/2012/moving-wordpress-multisite/
//http://codex.wordpress.org/Moving_WordPress
//http://www.realisingdesigns.com/2010/09/16/moving-the-domain-of-a-wordpress-multisite-install/
UPDATE wp_options SET option_value = replace(option_value, 'www.production.com', 'beta.development.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'www.production.com', 'beta.development.com');
UPDATE wp_posts SET post_content = replace(post_content, 'www.production.com', 'beta.development.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'www.production.com', 'beta.development.com');
I got it all figured out. Thanks all!
I dove into PHPMyAdmin for this. As it turns out, the only references to the "main" domain name are in a few original tables. In my case, I use domain mapping with the sites as subdomains (wildcard setup) so none of my sites actually operate at site.maindomain.com -- they all redirect to http://www.site.com.
In my case, I was transferring from "main" site http://www.mydomain.com to http://www.mydomainhosting.com and am using wp_ as the table prefix. I only had to update 1 to 3 entries in each of five tables:
wp_blogs, wp_options, wp_site, wp_sitemeta and wp_usermeta
I searched the database (not a single table, but the whole thing) for %mydomain% and found what changes needed to be made.
Finally, I changed the IP address at dm_ipaddress in wp_sitemeta to the new IP address. I set up all of the parked domains and email addresses, uploaded the database, and FTP'ed the files. Then, I changed the nameservers on the domains and voila -- back in business with a completely seamless transition and zero downtime.
Hope this helps someone!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment