Migrating EE site to new server, trying to test - "Welcome to Nginx"

Hello,

I had the unfortunate idea of starting a new site on a cheap VPS server. The site turned out to be quite popular and now I’m faced with the great pleasure of having to move it (it’s become too slow).

I have already created a new EE site on the new server, even specifying the database username and password so I don’t have to change too much.

I have also copied all the contents of htdocs.

Now, I’m trying to test if the new server is properly configured, and I can’t seem to get anywhere: if I modify /etc/hosts I still get the “Welcome to Nginx” message.

If I change the nginx conf, it generates a redirect to the current .com site (on the old server).

I’m going nuts as I can’t figure out what I’m doing wrong for the life of me.

Is there any way I can at least check that the database is all set up correctly? I can’t access the site on the new server with the ip address, no matter what I do.

I am using LetsEncrypt on the old server, could this be the issue? I figured I’d try to get the site working on the new server and then do the letsencrypt installation there after the DNS were already pointed to the new server.

Help!

Thanks in advance :blush:

Test your database connection with wp-cli. Example:

cd /var/www/domain.com/htdocs
wp option get home --allow-root

If everything is fine, you’ll obtain the site URL on screen.

Regarding SSL, I suggest you to migrate files and database (already done, right?) and point DNS correctly. As soon as you notice the domain is resolving to your new IP then you ee site update domain.com --le in order to install LE and the cert the correct way.

Tried the command, everything seems to work when I do that, I get

https://mysite.com

I think everything should work but considering my site is live and getting quite a bit of traffic, I’d hate to send visitors to a broken site without being able to do a reasonable amount of testing beforehand. Especially since DNS propagation would take a little while to revert back in case there’s a problem.

Thanks a lot for the reply!

In such case, I’d stand by a low traffic time in order to make the adjustments.

So you’re saying there wouldn’t be any way that you can think of to check the validity of the installation on the new server without jumping straight to directing the domain to it?

Not me, you said altering the hosts file didn’t work for you.

I can’t think of anything else.

Could it be that it’s LetsEncrypt messing with it? I’m thinking that maybe I need to change the easyengine config to use the IP address instead of the URL, and then modify /etc/hosts… that way it shouldn’t redirect to the live domain, perhaps?

I should add that I’m running Ubuntu 14.04 on both servers.

Trying to figure out why the redirect takes place… I’m still at a loss. I’ve tried enabling the RELOCATE in wp-config.php and when I go to the new ip login page, I get a 404. (i.e. http://1.1.1.1/wp-login.php)

I’m really not sure what’s up, any ideas would be greatly appreciated.

The process really is as simple as adding the site on the new server using ee, then pointing your local machines host file at that IP for that domain. That’s it. You should then be able to test all you need before switching the live site over.

You are using domain.com to access the new server, and not the ip address? (that’s the point of updating hosts)

Are you pointing domain.com and www.domain.com to same IP, in your hosts file?

1 Like

Hi, is your site in Wordpress? If yes, I have had a lot of success moving sites between new servers using Duplicator plugin. Try creating a different domain first on your new server then test migrating all the contents of your existing site to that test domain. If it works then you can be more confident that the migration would be successful for the actual site.

Hi Oobleck, did you ever solve the problem? Because I’m having the same problem you described in your original post.

I followed the migration guide here: https://easyengine.io/docs/site-migration/ (Copied the htdocs/ folder, database contents, etc.)

If I try to visit the IP address in my browser, I get the “Welcome to Nginx” page. But when I edit my /etc/hosts file, I get an error that “This site cannot be reached.” And it’s driving me nuts.