• Multisite main domain = refhair.nl (site id 1)
    refhair has 5 subdomains.
    goodbeauty.eu is one of them with site id nr. 5
    I need to change goodbeauty to main domain in the multisite.

    define(‘DOMAIN_CURRENT_SITE’, ‘goodbeauty.eu’);
    define(‘PATH_CURRENT_SITE’, ‘/’);
    define(‘SITE_ID_CURRENT_SITE’, 5);
    define(‘BLOG_ID_CURRENT_SITE’, 5);

    When I put the id number in the config file I see that in the wp dashboard goodbeauty has become main domain. But site is not working properly anymore.
    Images are gone, they do not link to the site-id(5) uploads anymore…

    What can I do about this? Anyone?

    Kind regards Richard

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Richard,

    Changing the main domain of the multisite should actually begin in the database *.

    You will need to update at least the following tables and options (shown in parentheses).

    * Remember to create a full backup before editing the database.

      wp_options (siteurl, home)
      wp_site (domain)
      wp_sitemeta (siteurl)
      wp_blogs (domain)

    You would also need to update the wp_options table for each subsite, changing the siteurl and home options.

    NB: Make sure to pay attention to whether the protocol (HTTP) needs to be specified or not. Options in the following tables should not have a protocol specified: wp_site and wp_blogs.

    You can find a detailed guide over here.

    Hope this helps.

    Kind regards,
    Mwale

    Thread Starter groenewoud

    (@groenewoud)

    Hi Mwale,

    Thanks for your reply, I already found these things on the internet and changed it but I think I’m still missing something.
    I have already 5 websites active. refhair.nl is active with site-id 1.
    goodbeauty.eu has to become main site and has site id nr 5.

    I thought if I put the id numbers in the config-file would be enough? But images are not following site id number anymore… (broken links) and also formatting is gone…

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'goodbeauty.eu');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 5);
    define('BLOG_ID_CURRENT_SITE', 5);

    If I change everything to goodbeauty in the database I loose refhair website…

    Isn’t there an easier way to switch websites? Or just a trick to repair the broken links …?

    kind Regards,
    Richard

    Hey Richard,

    I think I found a thread that has a solution to your problem.

    You asked about an easier way to do the switch. On the above thread, there is also a suggestion to use the All in one migration plugin. Something like so:

      export new.example.com with ID 5 and
      re-import it into example.com with ID 1

    As always remember to take a backup ;).

    Let me know how it goes.

    Cheers!

    Thread Starter groenewoud

    (@groenewoud)

    Hi Mwale,

    Thanks a lot I’m going to try this, I’ll keep you informed!

    Richard

    Thread Starter groenewoud

    (@groenewoud)

    Hi Mwale,

    I did not use the all in one migration plugin, it was to expensive for this project. At the end I changed ID numbers;
    define(‘SITE_ID_CURRENT_SITE’, 1);
    define(‘BLOG_ID_CURRENT_SITE’, 5);

    In the end I manually put the missing (link) photos in the root uploads folder and relinked them via the “Media Sync” plugin that worked.

    Hey Richard,

    That’s awesome!

    Glad you got it working, and thanks for coming back to share the solution!

    Kind regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change main domain in multisite’ is closed to new replies.