Ghost 5 Migration

Ghost 5 Migration

I've been meaning to move to Ghost 5 for most of the year. In a previous attempt, I found that Ghost 5 didn't support SQLite anymore and I wasn't up for setting up and maintaining a MySQL instance.

Then I found I have been loving the simplicity of it. Being a docker compose fan, the transition to using fly.toml was a breeze. The other great thing about is that its pretty cheap. Cheaper than the basic virtual machine instance I've been using for which the costs seem unreasonably high.

Then I found that Ghost 5 can actually run on SQLite, perhaps with some missing features. Since my use case is primarily a static website, it seems to work.

Another reason I wanted to move to Ghost 5, other than all the features such as built in search, comments and the new themes.

Migration Experience

The migration itself took an hour tops. Since then, I've been customizing the theme and adding blog post thumbnails to give the site a nice aesthetic feel.

Broadly, the key migration steps are as follows:

  1. Create fly.toml file, copying the environment variables from docker compose.
  2. Create a fly volume that is referenced in the fly.toml file
  3. fly deploy the toml file
  4. Export the JSON file with site data and then import into new site via admin interface.
  5. Export the existing image files from previous website, download them to local machine. Then upload them to the new ghost instance via the same upload interface.
  6. Download and apply the routes.yaml and redirects.yaml
  7. Download and import existing members
  8. Apply customizations to themes such as the start here page and the home page.

DNS Migration

Finally, after I was happy with how the setup looked in development, it was time to share the new site with the world.

This involved 2 key steps:

  1. Creating new SSL certificates via flyctl - flyctl certs create <insert domain name>
  2. The command above provides DNS settings that need to be configured in the DNS provider.
  3. Change the url of the site in the fly.toml file in the environment variable to point to the production site.