Forums

[resolved] Changing DOMAIN_CURRENT_SITE from IP to URL (14 posts)

  1. kylemcintosh
    Member
    Posted 1 year ago #

    Hi! I'm working on a WP Multisite that is currently in development using an IP address for the Current Site. I need to change it to the final URL shortly, and I want to make sure I have all my ducks in row.

    From what I've been able to find out, I'll need to:
    A. Change DOMAIN_CURRENT_SITE to the new URL in wp-config.php
    B. Download SQL file, change all references from IP to URL, Upload SQL file

    Is that it? Anyone see any issues with this, or recommend a better way? Any tips?

    Thanks for you help.

    Kyle

  2. No, that's kinda it, though I have this memory that Ron said something about how you could goober your options tables doing that. Darn it, where's WPMUGuru when you need him?

  3. Tim Moore
    Code Wrangler
    Posted 1 year ago #

    Yes, if the the URL (or IP Address in this case) is stored in a PHP serialized array, then you'll mess up your options table when you do a find/replace.

    You can use something like http://spectacu.la/search-and-replace-for-wordpress-databases/ to do it in a safe way. I use this script successfully very often, but I have heard it won't work for some people.

  4. kylemcintosh
    Member
    Posted 1 year ago #

    Does that plugin work for the database as a whole or just on a per site basis? Does that make sense?

  5. Andrea_r
    team pirate
    Posted 1 year ago #

    What Tim said. :) There's a few others out there too. Otto has another link, I keep forgetting to copy it in my file. :D

  6. kylemcintosh
    Member
    Posted 1 year ago #

    my bad. I just realized it isn't actually a plugin...

    I'll give it a shot. Thanks for the help.

  7. kylemcintosh
    Member
    Posted 1 year ago #

    Ok, I tried it out and unfortunately I got a "cannot connect to the database" error once I ran the "search and replace database" tool, and changed the current_site info in wp_config.

    Any other suggestions?

  8. Tim Moore
    Code Wrangler
    Posted 1 year ago #

    Did you edit the script and give it the database info? It needs the same info as you have in wp-config.php.

  9. Andrea_r
    team pirate
    Posted 1 year ago #

    Got phpmyadmin? you can do it from there. Or get a db dump and do it in there.

  10. kylemcintosh
    Member
    Posted 1 year ago #

    @ Tim -- yeah, the script worked. It just gave the site a Database Connection error. Not sure what the problem was.

    @ Andrea, yeah I'll try the DB dump. That's what I was originally planning, but Tim mentioned messing up the options table with a find/replace. With an IP address, it should be a pretty clean to replace that with an URL, no?

  11. Andrea_r
    team pirate
    Posted 1 year ago #

    With an IP address, it should be a pretty clean to replace that with an URL, no?

    No, unless the domain has the exact same number of characters as the IP address.

    And that's only if the IP is in any stored arrays in the db. Sometimes I just do those ones manually, one by one.

  12. kylemcintosh
    Member
    Posted 1 year ago #

    hmmm. It should be easier shouldn't it...

    Is this not more or less what I'm attempting?:
    http://wordpress.org/support/topic/changing-base-url-of-30-multisite-installation?replies=6

    Again, thanks for your time.

  13. Andrea_r
    team pirate
    Posted 1 year ago #

    It shoudl but it isn't due to the fact the URL is stored in multiple tables across multiple fields in the entire db. Find 'em. replace 'em.

  14. kylemcintosh
    Member
    Posted 1 year ago #

    So, I download the db, did a search-and-replace, and imported... and it worked!

    The only thing that didn't make it was some images in a slideshow plugin, but that's pretty minor stuff.

    Thanks for your input! Much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic