homepage Welcome to WebmasterWorld Guest from 54.204.249.184
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
MySQL Search / Replace - Switching root domain on Wordpress Multisite
tnet




msg:4581045
 1:46 pm on Jun 4, 2013 (gmt 0)

I have a Wordpress Multisite installation, and the root domain is set to root-domain.com. I would like to switch it with one of the sites of the network (site-in-network.com), and make it a root domain.

This way site-in-network.com would become the root domain, and root-domain.com would become one of the sites in the network (100+ sites).

I've done search and replace on a database before, and it worked, but I was dropping a domain all together, so I just replaced domain-a.com with domain-b.com. This time it is different, I want to keep both of them, and just switch the positions in the database.

I guess I would need to run a MySQL query. As far as I know, the root domain was set to something like "www.root-domain.com", and all other sites in the network were like "site-in-network.com" (without the .www part)

The database is about 0.5GB, so it would be good to get it right the first time.

Thank you in advance for any info.

 

JD_Toims




msg:4595155
 1:51 am on Jul 22, 2013 (gmt 0)

I haven't done this before, but the approach I would start with in mind would be to use PHP and "UPDATE Table SET col_with_network_sites='root-domain' WHERE col_with_network_sites='site-in-network" then "UPDATE Table SET root_domain_col='site-in-network'"

Hope it gives you an idea or two.

BTW Sorry no one got back to you in over a month with any ideas. I'll have to try to remember to check in here more often since I can usually at least 'throw a dart' at issues with MySQL.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved