Site Migration Breakdown

As stated in my previous post, I have migrated this site to Hugo, making it static. I made this decision mostly due to the Wordpress management requirements on myself and unnecessary hosting costs. The old theme was technically also static, but still required Wordpress to manage on the backend, with lots of plugins.

One thing that I will discuss in detail is that I have migrated away from Hostinger. Why? I was paying for features I was not actually using, my site’s analytics showed that I was consistently consuming negligible resources on the smallest web hosting plan they offered. So, I made the decision to switch from that domain hosting type to a simple VPS (with Nginx) through Ionos.

Converting from Wordpress to Hugo

The conversion process wasn’t too difficult, I ended up using two tools primarily. The first was a WP plugin Jekyll Exporter, that generated a zip file of the site in Jekyll format. After downloading it, I converted it to Hugo format with the second tool ConvertToHugo.

In a new directory, I created a sample site from the Hugo quickstart guide and applied the Beautiful Hugo theme. Once the server was running, I used the directory structure to figure out where to place my old content and arrange images correctly.

While a web server is required for themes to be applied to content correctly, only the public/ directory is needed after the website is rendered. I first tested this by moving the Wordpress site into a subfolder in the domain document root public_html/<subfolder> for brittanymitchell(dot)co and modified the .htaccess file to work with the incoming Hugo site.

Migration to VPS Web Hosting

As stated before, I have monitored resource usage/analytics for brittanymitchell(dot)co, and saw that I was consuming almost negligible resources. Hostinger offers great services that require minimum help from support in terms of website management, but why keep what I am not using?

I spent at most 2 days comparing different VPS providers to decided on one that was cheaper than cPanel and offered what I wanted. I decided on Ionos because of it’s low entry in terms of pricing, setup, and support.

In short, to host a website using a VPS only a few things are needed:

  1. Domain – this new domain was purchased with Porkbun
  2. VPS – Ionos
  3. Website Content – content of public/ from Hugo site
  4. Web server – this site uses Nginx

Setup VPS

I decided on Ubuntu 24.04 for the OS, and the smallest option for VPS.

  1. Connect to the remote server either in the browser or via SSH and update the system software with apt – apt update && apt upgrade
  2. Install nginx – apt install nginx
  3. [Optional] Create the document root – mkdir /public_html
  4. Using an FTP tool, copy the content of the public/ into the document root – if no .htaccess file exists, create it and add modifications to set the entry point (index.php, index.html, etc)
    • Nginx by default uses /var/www/html/ as the document root, but I wanted to follow the structure of my previous setup.
  5. In the DNS settings add the domain
    • [Optional] if using an external domain like me, grab the TXT record and add it to verify domain ownership – see Ionos example

Configure Nginx

The only needed nginx modifications are to customize the nginx default configuration and optionally adding the SSL certificate and key for the domain.Since I used an external site, I had to include a “custom” certificate. Ionos does not allow for certificates to be added in their console for external domains.

For simplicity, modify the root directory and references to the SSL certificate and key if needed. The certificate and key may need to be transferred using FTP.

Troubleshooting

  • I had some issues using converted files like *.crt, Porkbun provided *.pem files and they worked as is.
  • Keeping URL forwarding enabled while migrating causes unwanted redirects for subdomains.
  • Exporting a WP site is difficult, as most of the better tools need to be imported manually.

I wouldn’t say the migration was rushed, but I do have a deadline of mid-December 2024 until brittanymitchell(dot)co renews, and I didn’t want to keep it for another year.

Since there are no comments, please reach out to me on BlueSky for questions or feedback.