Migrate nginx setup from one host to another

I have a nginx + wordpress setup on my current host and is a live site. And I am planning to migrate it to another host(possibly digitalocean) and would set it up using easyengine.

I’m confused on the migration setup though.

Since this is a live site (live-example.com, I like to export/import stuffs in the background, before I actually point the domain to this new host.

Say, if I create a new wordpress setup in the new host using easyengine for temp-example.com and export/import posts/media/users etc.

What would be my steps during actual switch.
Which configurations should I change in easyengine / nginx conf at this new host for the switch to work ? (temp-example.com to live-example.com)

I do want the db and other stuffs created under temp-example.com to remain intact.
Except that live-example.com should now use those settings/files.

Is there any existing tutorial on this ?
Or could you guide me on possible approach.

Thanks

Wasn’t sure which forum this post belongs to (easyengine/wordpress-nginx), so created it under nginx support.

Hello Sriz,

It would be good if you setup new server using EasyEngine, follow the steps below,

  • Install EasyEngine: `curl -sL rt.cx/ee | sudo bash`
  • Install Packages: `ee system install`
  • Create a Website: `ee site create live-example.com --wp`

As you noticed we created a same domain on new server instead of temp-example.com to avoid search and replace later when we go live.

Now you need to import the live site web-root and database. After that, need to add your new server IP address to /etc/hosts file to check the new server is working properly.

To add entry in hosts file, check the commands below,

sudo vim /etc/hosts 1.1.1.1 live-example.com www.live-example.com

Note: Replace 1.1.1.1 with your new server IP Address.

If everything is looks good to you, then you just need to point new IP in your DNS settings.

Let me know, if you have any doubt in above steps.

Thanks for reply. I forgot to mention my main concern. Is there a way to test it in browser with the new nginx + wordpress setup before I actually point my domain to my new IP ?

Also, thanks for easyengine , it makes everything simple.

Yeah, you can cross check the site before making changes in DNS (domain registrar). Just follow the instruction mentioned my Mitesh above. Add new host IP and domain name in your local system hosts file, check the commands below,

sudo vim /etc/hosts 1.1.1.1 live-example.com www.live-example.com

Note: Replace 1.1.1.1 with your new server IP Address and live-example.com with actual domain name.

I hope it will help you.