Droplet from Snapshot problem

Posted June 9, 2016 3.6k views
UbuntuWordPressNetworkingBackupsConfiguration Management


I recently created a snapshot of my droplet, since i wanted two versions of my website on two different domains.

However, when i go into my new droplets IP, and do / admin, i still end up on my original admin panel, and cannot do changes directly in my copied droplet.

In other words, why is my ‘new’ droplet from a snapshot redirecting me to my 'old’ droplet whenever i try to login as admin to it?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

Hi all,

I also ran into this problem while transferring a snapshot of a WordPress site. It looks like WordPress will redirect to whatever URL is specified in the “home” WordPress option if you move the site onto another URL. Here’s how I resolved this:

First, make sure that this is actually the problem. Run:

$ curl -I

HTTP/1.1 301 Moved Permanently
Date: Thu, 17 Oct 2019 23:40:29 GMT
Server: Apache/2.4.29 (Ubuntu)
X-Redirect-By: WordPress
Content-Type: text/html; charset=UTF-8

The line “X-Redirect-By: WordPress” means that we’re actually hitting the right server, and WordPress is bouncing us back to the old URL.

To fix this, log into your new site via SSH (this won’t be redirected by WordPress). Then log into mysql with your root account and fix the “home” and “siteurl” WordPress options:

$ mysql -u root -p
> update wordpress.wp_options set option_value='' where option_name='home';
> update wordpress.wp_options set option_value='' where option_name='siteurl';

Finally, you’re going to need to clear your browser cache or it will keep redirecting to the old site. On Firefox you just run “Clear Recent History” and select “Cache” to do this.

  • Hi @chrismazzullo - I have tried the commands given above as a Sudo user, and they even seem to have been executed with no issues , but when I curl the URL again, the “X-Redirect-By: WordPress” to the Old site remains.

    What could I be missing here? I have disabled root login. Do I have to enable it and re-run the command(s) as root?

    Update: I have tried the above as root too, but the issue persists.

That’s not possible. Are you sure you’re using the correct IP? How are you verifying that the changes are being done?

  • I believe the answer here is that my wordpress configuration redirects to a custom URL, which means that this one will as well whenever i try to go to /admin, since they share those properties.

    Any suggestion on how to fix that?

    • The redirecting issue is fixed. However, i can not login to the new droplet using the same credentials as the original site. Any tips on how to add an admin to my wordpress on my new droplet?

      • Hi,

        If you restored a snapshot, the data is going to be the same on that snapshot as when you took it on the original droplet. So the admin/username password is the same. If you do not remember the original password, I would use wp-cli as explained here

Hello Zimpstar, I am having the same redirection issue, can you tell me how you solved it ?

I changed the url in wp-config, and function via ftp but still nothing changes, i can’t login to wp admin and phpmyadmin since i am redirected to the old one.