Trouble migrating the multisite to a new domain.

I am trying to move a multisite install to a new server and a new domain. I used a snapshot for that and then ran through the manual changes in htaccess, wp-config and in the db. I got that approach to work fine somewhen in the past. But now all I get is too many redirects error.

Which I seem to remember vanished the last time once I was done replacing the URLs in the DB

I used snapshot-installer to move the site and then followed this: After restore the multisite to a new domain with snapshot-installer.php you have to make some changes in the database, since snapshot was not designed for migration it doesn’t take care of them. Here’s the steps:

1: Change the DOMAIN_CURRENT_SITE, PATH_CURRENT_SITE, so it suit to new domain in wp-config.php

2: Change the RewriteBase in .htaccess or any domain related configuration.

3: Change “site url” and “home url” from wp_options table

4: Change the domain column to new domain in wp_blogs table in all rows.

Which worked for me before, that still leaves a few more places to change the domain in the DB but the site is loading after that but not this time. Please check and help.

  • Ash
    • WordPress Hacker

    Hello Peter

    You had a lot of references to the old domain, I have replaced with the new domain and imported to the database. But there is still the redirect issue.

    I have tried to login via FTP but it didn’t work for me. Would you please check again and send me updated FTP login?

    You can send me privately in the following format:

    1. Please go to https://premium.wpmudev.org/contact/#i-have-a-different-question

    2. Select “I have a different question” if not selected

    3. In subject line put “Attn-Ashok” (this will ensure that the email is assigned to me)

    4. Provide the wanted details.

    5. Add the thread link in the message so that I can track.

    Have a nice day!

    Cheers,

    Ash

  • Ash
    • WordPress Hacker

    Hello Peter

    Thanks for the details. I have tried in many ways but could not fix the redirect.

    We have sent your issue to our second level support team. Please note that, they deal with more complex issues, so there might be little delay. We appreciate your patience on this.

    Have a nice day!

    Cheers,

    Ash

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Peter ,

    I’ve made some changes into your wp-config.php and the _blogs table in your database so you can access your site.

    The issue here was that you have the multisite into a folder in your new server but you where trying to pass that on the main URL.

    As an example and to understand the difference:

    Let’s say we have test.com/wordpress/ ( this is your multisite ).

    [wrong] Your wp-config was configured to do this:

    define(‘DOMAIN_CURRENT_SITE’, ‘test.com/wordpress’:wink:;

    define(‘PATH_CURRENT_SITE’, ‘/’:wink:;

    [correct] it should instead do this:

    define(‘DOMAIN_CURRENT_SITE’, ‘test.com’:wink:;

    define(‘PATH_CURRENT_SITE’, ‘/wordpress/’:wink:;

    Since the actual “path” is a subfolder on your new server, it can’t appear within the domain. The domain is always the TLD url without anything else.

    I’ve also change the _blogs table for the main website only to correctly point to /wordpress/ .

    You’ll have to do the same for the subsites though: For example I see that you have a subsite called /content/ . That should instead be /wordpress/content/ in the PATH and the domain should only remain as the TLD domain.

    I hope this helps to give you a nice start. Also your /wp-admin/ should be loading fine now as well since the main site is configured properly.

    Tell me if you need any further help.

    Regards,

    Konstantinos

  • Peter
    • Site Builder, Child of Zeus

    Hi Konstantinos,

    you’re a star :slight_smile:

    Thanks for that. And I was sooooo close. I did try using URL and path settings in wp-config. But then I probably didn’t go on and make the changes in the db. Made things worse.

    I’ll get cracking on the rest tomorrow.

    Thanks again

    Peter

  • Peter
    • Site Builder, Child of Zeus

    Hi again Konstantinos,

    getting closer to the solution :slight_smile:

    The install ended up behaving in some weird ways so I ended up pulling a fresh snapshot file and migrating that instead. This time directly to http://www.mydomain.com without the subfolder /wordpress. All the credentials should be the same.

    I ended up with a new problem this time. I got all the pages to load. I can access admin for all subsites – but now I end up with the redirect error when I am trying to access /wp-admin/network.

    Could you work your voodoo again? I’ve tried digging through several options for db, htaccess, wp-config but I can’t make any sense of this one.

    Cheers,

    Peter

  • Ash
    • WordPress Hacker

    Hello Peter

    Sorry, I am bit confused. I have logged in using FTP and I can still see the files are in wordpress folder, not in the root.

    To clear confusion, would you please resend your admin login, cPanel login (or FTP and DB separately) so that we can check?

    You can send me privately in the following format:

    1. Please go to https://premium.wpmudev.org/contact/#i-have-a-different-question

    2. Select “I have a different question” if not selected

    3. In subject line put “Attn-Ashok” (this will ensure that the email is assigned to me)

    4. Provide the wanted details.

    5. Add the thread link in the message so that I can track.

    Have a nice day!

    Cheers,

    Ash

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Peter ,

    Your wp-admin/network/ should be working fine now. The issue was that half of your database entries where as “www.mysite.com” and others as “mysite.com” so WordPress was getting confused on where to use the www or non-www version.

    I’ve changed everything into www. as I saw that this was your defined in your wp-config and everything seems to be going fine now :slight_smile: .

    As an extra step you’ll find in your FTP a file named “.htaccess_fresh”. This is a fresh WP multisite rules that uses subfolders just in case you wanted to “revert” your htaccess back to a fresh start as well.

    Tell me if you need any further help!

    Regards,

    Konstantinos

  • Peter
    • Site Builder, Child of Zeus

    Hi Konstantinos,

    almost forgot: still wanted to thank you for your help :slight_smile:

    I almost found the error again myself – but stopped halfway on the www. Oh well. You live and learn.

    Got everything to work smoothly now thanks to your awesome magic.

    Peter

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.