• I backed up my site using updraft-plus and uploaded the backups to my new test environment where I installed a fresh copy of wordpress. I have a very old wordpress site so the purpose of the test environment is to see what happens when I update wordpress, plugins, etc.

    Problem:
    The whole site seems to redirect to the url where the database came from after I uploaded the database to the test environment. The test environment is a sub-domain on a different website that I maintain. For example, my test environment is test.testingsite.com, and the main website is mainwebsite.com.

    test.testingsite.com/wp-admin redirects to mainwebsite.com/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F

    Is there a variable I need to change in the database? Is there a best known method for maintaining a wordpress test environment that I am missing?

Viewing 3 replies - 1 through 3 (of 3 total)
  • It’s not one value in the database, there’s a lot of them. WordPress stored complete URL’s everywhere in the database, so it’s a very common problem.

    In the admin area, install the Better Search Replace plugin, and use that to change the old URL to the new URL. Then your site will be correct.

    Thread Starter jsonderulo

    (@jsonderulo)

    Thanks for your response Catacaustic.
    I’m still puzzled because I am unable to access my backend (wp-admin) after installing the new database so I’m not able to install Better Search replace on my back-end to replace anything. Maybe I could open the database locally and replace the variables. I assume I’d be looking up the old url and swapping it for the new one. Are there any other variables to consider?

    • This reply was modified 6 years, 9 months ago by jsonderulo.

    To start off, you need to use phpMyAdmin, or another database administartion tool, and set the admin URL in the database to the right URL. When you get into it, go to your wp_options table,a nd look for entries for ‘siteurl’ and ‘home’, and set both of these to the base URL for your sites new location. That will let you get access to the admin area, and you can do what you need to in there.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Redirects in my test environment?’ is closed to new replies.