Yesterday, I upgraded my server’s OS from Ubuntu 16.04 to Ubuntu 18.04. This was after one failed attempt.
For the failed attempt, I tried to keep my config files as I—or cerbot or another tool—had changed them. After the upgrade, my site wasn’t working, so I reverted to the snapshot I made before the upgrade attempt. At that moment, I wasn’t prepared to do troubleshooting, so restoring backup made perfect sense.
En lieu of an upgrade, I next started a migration to an Ubuntu 18.04 machine, but that seemed so much heavier than what I needed for this simple virtual PC. Namely, all I wanted was to upgrade to Ubuntu 18.04 and keep my website working. So, I stopped work on my migration effort.
My successful upgrade was rather simple. I logged on a sheet of paper the config files with updates, accepting the package manager’s version of config files instead of my version, presuming a dpkg backup would be made (which was true, for the most part). The upgrade took roughly an hour to complete.
Once I had Ubuntu 18.04 running, my site was down. It was serving up my PHP files as plain text, which is not ideal for various reasons, most having to do with security. Thankfully, I got it back up within 15 minutes by adding a line for PHP into my Apache2 config and disabling and enabling a couple of Apache2 modules (See: this forum post).
If you’ve been paying attention, I didn’t mention using a staging server or any other safeguard other than a snapshot backup, which is a computer image by DigitalOcean. My reason for approaching the task on my live system came down to convenience. It was more convenient to avoid a migration and instead opt for a relatively quick upgrade to the live system. This isn’t something I would ever do with another production system without better accounting for failover.