Easily configure a performant, secure, and stable NGINX server.Learn More
How to create a staging site from a live site with a let's encrypt ssl already installed?
We’re trying to build a large wordpress woocommerce site ( a bookshop with 50k+ products) but we’re hitting a bit of a brick wall in terms of making a duplicate staging site in digital ocean on a separate droplet.
We are using a Lemp stack on Ubuntu 18.04 with a let’s encrypt ssl that renews automatically via cron.
1) Take a snapshot of the live site
2) Spin up a new droplet of the same specs using the snapshot we’ve just created
3) Point our new staging domain name servers at the new droplet’s ip address
The problem we have is when we then try to navigate to our staging site we get 301 redirected to the live site urls each time. We can’t login to wp admin at all. I presume this is due to the ssl certificate having the live site’s details.
I’ve tried commenting out lines in /etc/nginx/sites-available that relate to the Let’s encrypt SSL certificate of the live site but that doesn’t do the trick.
Is it simply a case of finding and replacing all instances of the live domain name with the new staging domain name in the database and changing the domain names over on the ssl?
It would be great if there was a way of just removing the ssl from the staging site entirely via console, then just creating a new ssl that’s correct. Are there any places I should be looking in order to do this?
If there’s anyone who’s had experience of creating a staging site from a live site that already has an ssl on it, any help would be very much appreciated:) Unfortunately we have to do it this way.
Thank you in advance
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.×