1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

MySQL Search / Replace - Switching root domain on Wordpress Multisite

Discussion in 'Databases' started by joliett89, Jun 4, 2013.

  1. #1
    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.
     
    joliett89, Jun 4, 2013 IP
  2. PYO

    PYO Member

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    1. Back-up db.
    2. Make copy of sql file.
    3. Then find an all lines with domain-a and delete them.
    4. Open a copy and find all lines with domain-b and delete them.
    5. Combine both files.
     
    PYO, Jun 5, 2013 IP