Moving House - A Hugo and Netlify Story

I’d been hosting my website using WordPress on Arch Hosting. They just sent an email stating they’re shutting down in a month, which meant I needed to find a new host and migrate my website.

I had two options

  • find another WordPress host, run a backup on the current host, restore on the new host and re-point my DNS
  • switch away from WordPress and take greater control over my content

Option 1 is the easier by far. Every host offers WordPress hosting as an option and the process of migrating a site is simplified greatly with the use of the right plugins.

WordPress, which powers over 30% of the web, is superb for two sets of consumers

  • people who want everything working out of the box and will change nothing once they’ve created a site, given it a name and a theme
  • people/firms who have complex needs and a knowledgeable staff to help with

It’s less ideal when you want to tweak your website or theme, as that requires some amount of knowledge. A WordPress page is a fairly powerful and complex beast, and keeping it running fast and secure does take a fair bit of learning.

That opens the door for Option 2

I’d read an article on Hacker News around static site generators and why one might want to move to them. It made a lot of sense. Faster performance, greater control and greater security. I decided I’d give it a shot before giving in to Option 1.

This started a small saga of learning yesterday. Migrating from WP to a static site takes a few steps

  • Choose a static site generator. I worked through Jekyll, Hugo and Gatsby and decided on Hugo. My primary reasons were speed and theme support.
  • Choose a host. I decided on Netlify as it had a compelling set of features - a GitHub based pipeline, free Https, and best of all, free hosting
  • Migrate your content to Markdown. Things get harder now. The only plugins available didn’t work on the current version of WordPress, so I used Lonekorean’s script on an XML output
  • Clean up said markdown. Add more front matter, find missing images, etc. I modified the script for some of this, but had a fair bit of hand-fixing. Thankfully, I have so few articles, it was practical.
  • Find a good theme. This is where it gets messy. Each theme I tried had its own conventions and varying degrees of documentation. My needs were few - as you can see my blog is simple - but finding one that worked seamlessly was really difficult. Just as I was giving up, I came upon Nederburg, which did everything I needed.
  • I could have used a CMS to build the site, but I felt that it’d be better learning for me to do this from scratch. Learn markdown, learn the .toml files, understand how Hugo works, and having a complete environment locally to build and debug with. This worked really well, and in a few hours I had the skeleton of my site running fine. BTW, this is the first time I used VSCode. I could live in it forever. VSCode feels so gooooood.
  • Finally, when I felt I was ready, I pushed all my files to GitHub, add them to Netlify, tested the local Netlify link and iterated until everything worked
  • A day and several check-in’s later, I was ready. I re-pointed my DNS and my site flipped in a couple of hours.

It feels stable, fast and light. It looks good and works well. Total time invested - less than two days.

I’d heartily recommend this route for anyone who’s looking for an alternative from WordPress.

if you’re interested, here’s a set of good articles on the reasoning, process and experience.

Image courtesy Erda Estremera on Unsplash