If you want to change the primary domain on multisite, the actual process for a new WordPress install is pretty easy - you need to change it in your wp-config.php file, then in your databse - including siteurl and home entries in wp_options and the wp_site table.
The problem comes in if this site has been in use for awhile. Many areas of the site may store the full URL in widgets, theme options, and media uploads. All of these have to be changed as well. You can search through the database and replace them - but sometimes the data is serialized, meaning it won't be picked up by a simple find and replace.
So, it's up to you. It is doable, but depending on the amount of time the site's been live and in use it may be quite a bit of work.
It's been a while since I've attempted something like that and things have changed a little since then so I'm not totally sure how that would go but the following article seems to provide some good detail on specifically that, and seems quite up to date too! http://www.wordpress-website.org/change-primary-domain-wordpress-multisite-network/
Ah, actually, Mason's got you covered there! That article doesn't cover the plugins and theme options on an existing network, and those are important considerations.
I discovered a GREAT tool that allows you to do a full search and replace on your MySQL database, AND handles the issue of serialized data. This works not just for the domain name (which was my issue) but any other search and replace.
Responses (6)
Sales & Support Lead — 24th October 2011 #
Hiya,
If you want to change the primary domain on multisite, the actual process for a new WordPress install is pretty easy - you need to change it in your wp-config.php file, then in your databse - including siteurl and home entries in wp_options and the wp_site table.
The problem comes in if this site has been in use for awhile. Many areas of the site may store the full URL in widgets, theme options, and media uploads. All of these have to be changed as well. You can search through the database and replace them - but sometimes the data is serialized, meaning it won't be picked up by a simple find and replace.
So, it's up to you. It is doable, but depending on the amount of time the site's been live and in use it may be quite a bit of work.
Thanks!
WPMU DEV Fanatic — 24th October 2011 #
Hi Dustin,
It's been a while since I've attempted something like that and things have changed a little since then so I'm not totally sure how that would go but the following article seems to provide some good detail on specifically that, and seems quite up to date too!
http://www.wordpress-website.org/change-primary-domain-wordpress-multisite-network/
Hope that helps! :)
Cheers,
David
WPMU DEV Fanatic — 24th October 2011 #
Ah, actually, Mason's got you covered there! That article doesn't cover the plugins and theme options on an existing network, and those are important considerations.
Member — 24th October 2011 #
Ok, I will probably just leave things as they are then. How can I "link" another site to the other network? Should I use the domain mapping plugin?
Sales & Support Lead — 25th October 2011 #
You could use domain mapping or setup a 301 redirect either at your domain registrar or through the .htaccess file.
Member — 26th October 2011 #
I discovered a GREAT tool that allows you to do a full search and replace on your MySQL database, AND handles the issue of serialized data. This works not just for the domain name (which was my issue) but any other search and replace.
Check out: http://interconnectit.com/124/search-and-replace-for-wordpress-databases/
They also note that this tool is not designed just for WordPress - it can be run against any MySQL db in a PHP environment.
I've used it and it works brilliantly - the serialized data entries in the DB all were replaced and updated properly.
Best. Thing. Ever.
Become a member