I actually updated my site (https://cfxdesign.com) on the night of the bump. Been meaning to write a walkthrough but here are my notes from that night:
- Backup your original site’s database and uploads directory.
- Create a new droplet running Ubuntu Xenial 16.04.1x64
- Edit your zone file and point a new subdomain to the new droplet, e.g.
xenial.mydomain.com
. - Now create a new environment. For this I copied
group_vars/production
togroup_vars/xenial
andhosts/production
tohosts/xenial
. In mygroup_vars/xenial
I changed the site host URL to reflect my new subdomain and inhosts/xenial
I edited the IPs to reflect my new droplet’s IP. - Provision your new Xenial droplet.
- Deploy to your new Xenial droplet.
- You’ll now need to copy over your db backup and uploads dir. To push uploads you can use this playbook (Pushing or pulling uploads with Trellis) and to copy your db you can use
rsync -avz
along with wp-cli to import and change the URLs in your db (there may be a playbook for this out there). - Verify that
xenial.mydomain.com
is working. - Now we’ll pull a little switcheroo and make our Xenial install our main install. Edit your Xenial
wordpress_sites.yml
site host back to your original domain,mydomain.com
and delete your SSL certs on the Xenial droplet (like this Let’s Encrypt issue when adding new domain to multisite) - Change the URLs on your Xenial droplet db to your original URL with
wp search-replace '//xenial.mydomain.com' '//mydomain.com'
- Point your DNS @ record to the xenial droplet’s IP.
- Run
ansible-playbook server.yml -e env=xenial --tags "wordpress"
- Run
ansible-playbook server.yml -e env=xenial --tags "letsencrypt"
- Now you can remove the subdomain A records from your DNS config and delete your original, outdated droplet running Trusty 14.04.
- You can and should rename your original environment and your new environment (
production
->production_old
andxenial
->production
). The only deploy variable that will be affected by this is your database name. Unless you specified it, yourdb_name
is set to<site name>_<env>
when you provision your server. You can either change the db name on your server or in yourwordpress_sites.yml
. Now your deploys work just as before. - Profit.
Total down time was just the few minutes it took to generate the new SSL certs (although it’s highly recommended to ensure you haven’t reached your SSL certificate limit before embarking on this whole thing).