[The Hub] Domain Name Change: Keep Existing Hub Connection When Site is Hosted Elsewhere

0

Occasionally a website changes it’s primary domain name. When the website is hosted on WPMUDev, changing the primary domain name automatically brings the existing “Site” in the Hub to the new domain name and all existing settings and SSO and backups come along for the ride.

However, when the website is hosted elsewhere, there’s no way for the Hub to stay connected when the domain name changes, or for us to configure the Hub to now use the new domain name for the existing connection. Instead we have to setup a new site in the Hub.

This is a problem for the services we provide clients because:
– We cannot restore the backups we have on file
– We cannot provide complete reports for the last month/week/etc because we don’t have the analytics
– We have to take the time to setup and configure a new site on the Hub
– We have a more complicated management process (we have to track the existing Hub connection and remove it from “freak out it shows the website is down”, and then remove it at the appropriate time)

We would love to have a feature where we can go to the Hub > settings for a specific connection and simply change it to a new domain name, and have the Hub just come along for the ride.

Thanks for your consideration!

  • Pawel Pela
    • Ex Staff

    Hello Butterflyly !

    Hope you’re having a good day!

    For those occasions we have a define that you can use to change the site’s domain in the Hub manually:

    define( 'WPMUDEV_HUB_SITE_URL', 'https://desireddomain.com');

    After adding it, please visit the WPMU DEV menu and at the bottom click the “Check again” link – it will force a re-sync with the Hub and it will also enforce using the provided domain. Then you can switch the actual domain and it should work fairly seamlessly (possibly Uptime will notify of the site being down for a moment).

    As for the feature in the Hub, I’m not sure if that’s possible, but I’ve created a feature request and sent it to the Hub team for further review.

    Kind regards,
    Pawel

  • Olivija Guzelyte
    • WP Core Meltdown

    Hi there Butterflyly

    Thank you for your response!

    You can add this define to your site’s wp-config.php file found in the root of your site files. You’d have to add it just before the line that says:

    /* That’s all, stop editing! Happy publishing. *

    After that, please click to check for updates at the Dashboard plugin like Pawel mentioned in the previous post. You can find the button within the WPMU DEV > Dashboard section, please refer to the image below for a visual guide:

    [attachments are only viewable by logged-in members]

    Kind regards,
    Olivija

  • Olivija Guzelyte
    • WP Core Meltdown

    Hi there Butterflyly

    Thank you for your response!

    So basically just like Pawel said in the first post, the process would go like this:

    1. You add the define to wp-config.php file.
    2. Visit the WPMU Dev plugin and click on the ‘Check again’ link. During this time Uptime may show the site as ‘down’ as it will be checking the new domain.
    3. Complete the change with the 3rd party host.

    You should keep the define in the configuration file as it is just there to tell the Hub what the correct site domain is. It’s kind of like a constant. It doesn’t have any performance impact. You could try removing it if you so wish, but I cannot guarantee you wouldn’t experience some unexpected behaviour.

    Kind regards,
    Olivija

  • Tony G
    • Mr. LetsFixTheWorld

    I requested a similar change a few months ago. In the Hub back-end, the domain is essentially the record ID/key to data records. The WPMUDEV_HUB_SITE_URL is a hack to get around that design error. Who does that in the 21st century?

    In the 1980’s we learned not to do that with people’s names, phone numbers, driver’s license numbers, license plate IDs, social security numbers, postal codes, city names, and so many other identifiers. The problem is that all of this data changes, even data that “should never change”. The solution – make the domain just another field, not a primary key, and use a foreign key index.

    C’mon DEV, hire programmers who have some real world experience, not just the ability to code.