So I have a Wordpress MU setup where we’re hosting a bunch of sites/blogs (email me at sumit AT tivixlabs.com if you’re interested in one).
As with all my Django webapps I wanted to replicate all the sites on qa for testing purposes (so that we’re not messing production sites with plugin / wordpress upgrades etc.). The problem is the qa site runs on a different domain (say domain2.com) than the production MU install (say domain1.com).
Since my stores the domain in 1 file (easy to fix) and a bunch of db tables, the easy solution is to:
- Make a copy of entire wordpress directory and put the correct domain in wp-config.php in this line: define(‘DOMAIN_CURRENT_SITE’, ‘domain2.com’ );
- Take a dump of your existing MU installs database. Open that dump file and do a replace of all “domain1.com” strings with “domain2.com”. Next do a replace of “domain1″ with “domain2″. Source this new dump into the new database for the new MU instance.
Thats it. These 2 steps should be it. Your MU site should now run like your old one, but at domain2.com and all existing sites/blogs will run at old-sub-domain.domain2.com too!