Blog maintenance

Moving my Ghost blog database from SQLite to MySQL & some optimisations.

Blog maintenance

When i moved this blog from Hugo to Ghost back in 2019 i just stuck with most of the defaults (i did change the URL structure for posts to /YYYY/MM format, rather than dump all posts to the root directory).

One of those defaults was to use SQLite as the database. This suited me fine as there are few visitors here, even fewer posts, and Nginx is acting as a caching proxy in front of Ghost anyway, keeping load extremely low. And so it continued to chug along for almost five years, working through upgrades from Ghost 3.x to 4.x and then to 5.x.

With the release of Ghost 5.0 in 2022 the only officially supported database is now MySQL 8 so, while i've never had any problems with SQLite (indeed i prefer it as i dislike faffing around with databases), i figured it was about time i made the switch.

The impetus for this move is that i'm planning to switch the VPS this site is hosted on from Debian to NixOS, with Ghost and MySQL running in containers as systemd services using Podman, but that's for the future. For right now i simply added a new Docker container for MySQL 8.4 attached to the Ghost container.

As i was doing a bit of blog maintenance i went through the feature images cropping, resizing (i standardised on 1200x800 pixels) before exporting them to .webp format. Unlike 2019 all modern browsers now support .webp making for some substantial file size reductions. I backed-up the original files in the hope that i can redo them in JPEG XL in a few years when all the browsers support it.

While doing this maintenance i also discovered a few settings to tweak the look of the blog. I'm not sure if they were there when i set up version 3 of Ghost and i missed them, or if they've been added in the intervening years, but i think they make things a bit cleaner.

My next post will probably be about moving from Debian to NixOS on this VPS.