Roots Discourse

Production Website


#1

I have successfully deployed staging.MyWebsite.com. It’s working(obviously, I don’t own MyDomain.com but you know what I mean). Now it’s time to move the main domain www.MyWebsite.com! However, I am puzzled. MyWebsite.com is currently operational. What are the best practice steps? Here are a couple guess.

Plan A (I don’t like this at all)

  1. Have group_vars/production files ready & Have db ready - search/replace domain
  2. Change DNS, point to DigitalOcean server IP
  3. Wait until the domain point to the server
  4. Wait. Check. Wait, not yet… check… NOW IT’S SWITCH! PUSH THEM TO SERVER NOW NOW NOW

Plan B

  1. Have group_vars/production files ready & Have db ready - search/replace domain
  2. Provision to a production server in DigitalOcean
  3. Change DNS
  4. Wait. Check. Wait.
  5. Deployment. Replace DB

Plan C

  1. Have group_vars/production files ready & Have db ready - search/replace domain
  2. Provision to a production server in DigitalOcean
  3. Deploy with IP address (Can I? ./bin/deploy.sh production 123.456.789.000)
  4. Replace DB
  5. Change DNS

Or… can someone demolish my Plan A, B &C and create Plan D?

With a huge support from this community forum, my trial errors experiments started paying off. This is the first time I am doing it for production website, I am bit nervous. Any suggestion/tips is appriciated :slight_smile:

And lastly, is there any professional service so I could get some help if things get terribly bad?

Thank you!


#2

Plan D

  1. Have group_vars/production files ready & Have db ready - search/replace domain
  2. Provision to a production server in DigitalOcean
  3. Deploy with IP address (Can I? ./bin/deploy.sh production MyWebsite.com)
  4. Replace DB/Uploads folder/Theme/Plugins
  5. Change DNS

Nevermind. This worked. I was overthinking. I wasn’t sure If I could do the deployment part without pointing the domain to the new hosting first.


#3

I would:

  1. Create new DO droplet
  2. Add a line to your hosts file to point MyWebsite.com to your new IP
  3. Provision and deploy as normal to your new production droplet
  4. Add database and uploads (I use a bash script to leverage WPI CLI to export database, replace production database and then search and replace, then rsync uploads over to production)
  5. If you’re happy with everything, update the DNS records and remove the line from your hosts file

That would be for non-SSL. In the case of SSL, I would initially provision and deploy as non-SSL, then reprovision and deploy after the DNS records have been updated.


#4

“Reprovision”… What would happen if we reprovision to an existing droplet that is already provisioned previously? Wouldn’t it mess up things? Or you meant , to create a new droplet and provision on it.


#5

No, you can safely reprovision (run server.yml against) an already provisioned server.