Straight from the “make work for yourself because there aren’t enough hours in the day already” files.

I’ve mentioned before that I am self-hosting this blog rather than using a hosted instance. I hosted the WordPress instance on FreeBSD and it’s been running quite well for a while, but during a double FreeBSD port upgrade to WordPress 5.0.1 and PHP 7.2 – after the php 7.0 port had been discontinued – broke the blog. php-fpm failed regularly with a signal 10, but I wasn’t able to figure out why in a hurry, so I started looking at alternatives.

First attempt, redirect to the static version of the blog

I’ve maintained a Jekyll version of the blog for a while, and despite being in a rush, decided it might be a good idea to complete the migration to Jekyll. The main problems I ran into were twofold – I still hadn’t managed to set up comments on the static blog, and all links to the blog (like feeds and permalinks) needed tweaking. Making permalinks look like the permalinks of the WordPress version of blog , all I needed was to change the permalink setting in my _config.yml to the following:

permalink: /:year/:month/:day/:title

Well, that was easy.

The other issue was to make sure that the links to existing feeds including category feeds were still working. That would have required some nginx voodoo but was doable. With me trying to get the blog back up and running quickly, I decided to hold off on the additional experiments and move to plan B.

Second attempt, migrate to another WordPress install

As a temporary “get this thing back on the Internet” fix, I decided to stand up another WordPress instance. The old, often upgraded instance had become a tad flaky already, plus I wanted to migrate the site to Vultr.com anyway as all my other servers are hosted by them. I do have a backup of the WordPress install via the UpdraftPlus plugin, so I ended up using Vultr’s prepackaged WordPress application image that Vultr. The sequence of the restore went something like this:

  1. Install the prepackaged application image on one of their $10 instances. The image uses Ubuntu 16.04 LTS and WordPress 4.9.8 at the time of writing. It installs quickly and works right out of the box. I probably could have got away with a smaller instance, but the instance size roughly matches the instance size of the previous blog and has some headroom.
  2. Point the blog’s DNS entry at the new instance. You can do this later, but doing it at this point makes things easier when it comes to the restore process.
  3. I installed the Ubuntu system updates while waiting for the DNS change to propagate. This gave me a new kernel so I rebooted the VM. Don’t do a distro update at this point. Make another pot of tea.
  4. Go through the basic setup and install the UpdraftPlus plugin. Connect the plugin to your backup storage, then rescan for existing backups.
  5. Restore from backup and clean up things a bit. As I’m backing up everything including plugins and themes, this was a one stop restore.
  6. As I’m using Let’s Encrypt’s certificates, I had to add the external repo for certbot.
  7. Make sure things work again, and in my case, brew more tea.
  8. At this point, I decided to update to the newer 18.04 LTS Ubuntu release. The easiest way is to do this from the virtual console  as Ubuntu will complain if you try to update from an ssh session. The update went smoothly, although it somehow misplaced the php mysql connector. I installed the php 7.2 mysql connector manually to fix the issue. I also I needed to manually configure the settings for php-fpm 7.2 version that comes with Ubuntu 18.04. Fortunately the upgrade leaves the original configuration in place, so this was just a matter of copy the relevant settings – listen and the user/group setting – from the old configuration.
  9. Yay, it’s finally all working again. Or almost, at least – I still need to take care of a few tweaks, but overall the blog is up and running again.

I still need to make some additional tweaks but the system is finally up and running. Time to get back to blogging, methinks, although I still want to move to a static site that consumes fewer resources than a full on WordPress install.

Disclaimer: The Vultr link is an affiliate link, and if you decide to make use of the link, I’ll get a small commission that helps keeping this blog running. I’ve been using Vultr for the majority of my hosting for about a year now and am very happy with their service.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.