• I have to change over 1600 instances of the IP address throughout a huge multisite (over 100 sites in the network) and I’m preparing to launch tomorrow. I have had issues in the past while trying to update all instances of the URL in the database, because phpMyAdmin would just timeout with such a large Import. I don’t want to have that issue again tomorrow, so I was hoping someone might know how to perform a global search and replace in phpMyAdmin. I just need to update the URL, the site is already on the server so we’re not moving the files to a new hosting environment.

    Does anyone know how to do this safely and effectively? I have only found information about how to change the URL in the options, but not globally. With over 100 sites to change and over 1600 instances of the URL, there has to be a more efficient way to do this, right?

    Thanks in advance~

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    The search/replace tool here is what you want 🙂

    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite

    Thread Starter Treebeard

    (@malawimama)

    Almost does the trick, I guess that would work if the database were much smaller, but with this tool you still have to know which tables to change. It’s the same thing as going into phpMyAdmin and selecting all the tables you need to export. I tried doing that and after an hour digging through the database I decided to ditch that, way too time consuming.

    What I really need is a search and replace function without knowing which tables need to be updated, that would be the most efficient way. After searching the database for the IP address, there are about 100 tables that need to be updated, with 1652 instances of the URL.. With that tool you still need to click through and select each table, and what if I miss something through human error…

    I was hoping to do a search and replace. I know how to search, I just don’t know how to replace that string.

    With the multisite, each table starts with a different number, each number assigned to the network site, so for instance, wp_105_options, wp_105_posts and there are a few extra tables in each network site that are associated with plugins we have installed. It’s insanity!

    I could go through the database and select all the tables that need to be updated based on the search results, export those tables, updated them, and then import again. But that’s the long way, I’m sure. It may be the only way though, for someone that doesn’t know mysql inside and out, I guess.

    (I also have to do the same thing to change the admin’s email address, which stinks!)

    Thread Starter Treebeard

    (@malawimama)

    I just found a script that doesn’t require the tables to be selected, and it works great in case anyone else needs it:

    http://sewmyheadon.com/2009/mysql-search-replace-tool/

    I just ran it through a test site and it works great. All you need is the database username and password, you don’t select any tables, it searches all the tables in the database for you.

    🙂

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    The reason I don’t suggest that one is I’m not 100% sure it handles the data serialization as the other does.

    Thread Starter Treebeard

    (@malawimama)

    That’s the dilemma really. I have over 100 tables to change… 1652 instances in all.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    You can select it to run on the whole DB, you know, the one we suggest 🙂 Just select all tables.

    Thread Starter Treebeard

    (@malawimama)

    I’m going to give it a try, thanks! (BTW, are you sure it won’t time out on a huge site?)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Hard to say. It’s pretty fast for a PHP script editing DBs. You could always export your DB and run it all locally, then upload the DB back to your server, but it’s all a function of memory.

    I might actually go so far as to put up a .maintenance file to take my sites ‘down’ for maintenance.

    Thread Starter Treebeard

    (@malawimama)

    Well I tried that search and replace tool from interconnectit.com and it didn’t work for changing an email address throughout the multisite database.

    In phpMyAdmin it showed 454 matches for the email address, and after running the search and replace tool from the Codex, it only changed 69 instances so phpMyAdmin still shows 385 instances unchanged.

    I haven’t run it for the URL yet, I’m afraid it’s not going to work properly.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Are you sure you selected all the tables to run it through?

    Thread Starter Treebeard

    (@malawimama)

    Yes. Anyway I’m just uploading the dataabase with the URL updates, in pieces (because it’s too large). Been at it for hours now… Hope it works!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Change multisite URL globally in huge multisite’ is closed to new replies.