Provision and deploy to a production web server before changing a domain address


I am wondering what is the best practice for publishing new sites that currently already exist on another server with an existing domain, with minimal downtime.

This is how I do it:

  1. Spin up a new droplet on DO
  2. Change the hosts entry in trellis/hosts/production
  3. Change the group vars to resemble the existing domain
  4. Provision the server
  5. Deploy to server
  6. Change the local /etc/hosts file to fake the DNS and point the old domain to the new DO droplet IP without changing the domain itself
  7. Check if everything is OK
  8. Point the old domain to the new server

All things considering, this should work. I am not getting any errors on provision or deployment, but when I try to open the site in the browser i get a net::ERR_TOO_MANY_REDIRECTS

1 Like

What did you change this to? Is it the DNS name that’s also in your local HOSTS file, or is it some other address?

Can you post your group_vars for production?

@alwaysblank, @MWDelaney seems like our company has a sophos firewall in front of the network, and the firewall was the source of the issue.

1 Like