Network Admin Redirect Error After Demoting a Site

Hi - I have a redirect error, when trying to login to Multisite Network Admin (all site dashboards are accessible). I know exactly what I did to cause the error, and I'm hoping someone can help me revert back.

Background: I have a subsite (e.g. sandbox.domain.com) that I wanted to make the main site (domain.com). I wanted to take the current main site, and make that a sub site.

So, after doing some reading, I took this line in wp-config.php:
define('BLOG_ID_CURRENT_SITE', 1);

and changed the 1 to a 2 which is the sandbox site. That didn't really change anything, so I went into network admin, into the site settings, and I changed the URL of the domain.com site to sandbox2.domain.com. (My thinking was I'd do that, and then change sandbox.domain.com to domain.com).

When I submitted that change, the Network Admin was no longer accessible. All sub-sites are still accessible, but the main site isn't, and the network admin isn't. i pulled up phpMyAdmin, thinking I could change the URL reference back via MySQL, but I couldn't find the sandbox2.domain.com reference anywhere.

I also tried to use WP-CLI, but when I do a command like, "wp network meta list", I get the message, "Site domain.com/ not found.

So, how can I undo what I did? Bonus question - How can I swap my main site and sub-site?

Thanks!!!!

  • Tyler Postle

    Hey Alaa,

    Any chance do you have a backup from before you made the network changes? If not, you could also ask your host - often they do scheduled backups in the background so you could get your site restored back to before the change was made. This would likely be much easier than hunting down issues.

    Then once it's back to normal you can use our Cloner plugin to do what you want: https://premium.wpmudev.org/project/cloner/

    As you can see in my screenshot below, you can clone subsites to the mainsite:

    Before doing that you would want to clone the main site to a subsite and then once you've cloned your desired subsite to the mainsite, you can clone the cloned subsite to the other subsite :smiley: if you wanted to keep the same url for the original subsite anyway.

    If you aren't able to get a backup of your site to restore then can you send us your cPanel and wp-admin? So we can have a look?

    You can send that privately through our contact form: https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me.

    Send in:

    Subject: "Attn: Tyler Postle"
    -WordPress admin username
    -WordPress admin password
    -login url
    -cPanel credentials (login url/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Cheers,
    Tyler

  • Alaa

    Thanks for the reply! I got the site back. What I did (for anyone in the future reading this thread) is that in my wp-config file, I changed the...

    define('DOMAIN_CURRENT_SITE', 'domain.com');

    line to be sandbox2.domain.com to match what I incorrectly put in. I also put in a DNS entry for the same. That allowed me to get back in, and I changed the site back to the way it was, and reversed the wp-config change.

    I used the cloner to move the sub-site to the main site, which worked, but I am experiencing an issue. It looks like another user had the same issue which was unresolved.

    https://premium.wpmudev.org/forums/topic/cloner-plugin-not-copying-media-library

    The issue is that I am getting a 404 error when the cloner attempts to copy the media files, and none of the media files got copied over.

    I will send my credentials separately per your post above. Would I still send them to you even though the original issue is resolved and I have an issue with the cloner? Thanks in advance.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.