Introduction
Hello everyone
This is a quick post on how I migrated my blog from WordPress to Hugo. I will not go into details on how to install Hugo or how to use it, but I will share some of the things I learned along the way.
Iāve also written a simple tool in Python to aid you in the migration process. You can find it here: https://dnutiu.github.io/jekyll-to-hugo/
Why not WordPress?
Iāve been using WordPress for about 5 years now, and Iāve switched from free hosted WordPress to self-hosted and then to premium hosted WordPress.What I donāt like about WordPress is that the quality of free hosted blogs went down, for example you cannot have plugins, youāre not in control of your blog, they might delete it without warning, and you have ads and banners on your blog.
The cheaper premium version gives you limited theming options, and it is required if you want a custom domain for your blog. The more expensive version of premium WordPress gives you more features, but itās not worth it for me and my use-cases.
The open-source version of WordPress is even worse, you have basic blogging functionality but if you want to protect yourself from Spam youāll need to install JetPack which is free for basic features and everything else is paid. Plugins for SEO, Code Highlight, are free for basic features and when you need something more complete youāll need to pay for it.
In the end paying for hosting, managing the database, handling backups and upgrades, subscription to wp theme, paying for plugins not worth it at all, youāll quickly reach tons of $$ per month only by paying for micro features that should be included and pluginsā¦



And, if you decided that youāll use the free version of plugins each plugin will add a banner to your WP Admin dashboard in order to āremind youā to upgrade

Every time I wanted to write a blog post I was greeted with ads and reminded to āupgradeā and that was a turnoff for me.

WordPress is not for me anymore.
Why Hugo?
Hugo gave me complete control over my content, and now I can write my posts directly from my IDE in markdown
It also has lots features

The content is also static, that means a fast website and easy hosting.

Migration
To migrate your blog youāll need to install a plugin called jekyll-exporter. It will export your posts into a Jekyll post format, which then can be converted to Hugo format.Then Iāve used the Jekyll to Hugo tool to migrate my blog from WordPress to Hugo.
Since my blog was hosted on WordPress.com and I had the cheaper premium plan that did not support plugin installations I had to improvise.
Hereās a demonstration video:
Docker-Compose
The docker compose file is used to the blog inside a container:
YAML:
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress:/var/www/html
- "./php.ini:/usr/local/etc/php/conf.d/php.ini"
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
wordpress:
db:
The
php.ini
file in order to override upload defaults.
Code:
upload_max_filesize = 10M
post_max_size = 10M
