When I finally decided to start my personal blog back in 2013, I choose Wordpress as its blogging engine. Despite the fact that there is a big hype with Wordpress right now, I decided that its time to move to a more simpler engine.
In this post, I will explain the reasons for moving from Wordpress to Jekyll and describe my migration experience.

Wordpress

Wordpress is one of the top-3 platforms to choose (the other two are Joomla and Drupal) when it comes to develop a new website.
It has a strong community of developers, a multitude of plugins to add functionality to your website (from photo sliders to more sophisticated plugins like Wordfence) and many web developers around the world use it as the basis for their end-products.
In my experience with Wordpress, I wouldn’t say that it suits me pretty well. The WYSIWYG interface always puzzles me and it hinders me from writing. Hence, I prefer a more simpler editor.
Of course, Wordpress has support for Markdown (that I am currently using to write this post), but for a couple of reasons I couldn’t use this option.
Another reason was that Wordpress, like any other CMS, needs regular updates both in its core and on its plugins. Wordpress has done great steps on improving its stability and security on its core. But when it comes to its themes or plugins, things are not the same.
Many users dread to update to a new version of a theme with the fear of breaking the entire site. The same lies to plugins, plus some of them are prone to vulnerabilities (remember the RevSlider vulnerability back in late 2014?).
Along with some minor limitations that my Wordpress installation had (that could be resolved with some effort), I decided I need a simpler engine for my blog.
Hence, I chose Jekyll. Besides, I thought that would be interesting to tackle with something new and I had a hunch that Jekyll would be better for me.

Jekyll

Jekyll, is a static site generator written in Ruby. It uses a simple template to convert posts in text files to a complete site with links.
Jekyll is widely used and it is incorporated in Github Pages as its rendering engine. No database is required, just some files representing your posts.
The basic workflow for writing a post to Jekyll is the following; Open your favorite text editor, write your post (for example in Markdown), generate your entire site using jekyll build and upload the generated content to the document root of your site.
Jekyll functionality can be extended with the use of plugins, so Jekyll can be tailored to your needs.
Jekyll has a great documentation to start with. You can also watch some introductory tutorials and casts in jekyll.tips.

The fact that posts are flat files gives you the opportunity to track changes using a Versioning Control System (VCS), like Git. This eliminates (up to a point) the need of regular backups to your site.
If something happens, you can re-render it and upload it again. Just ensure that VCS repo is replicated, by maintaining a remote copy in e.g GitHub or BitBucket.
Jekyll offers a simple web-server out-of-the-box, to test your changes. Type jekyll serve inside your Jekyll directory and visit the generated site on your browser at http://127.0.0.1:4000.
This test environment is great for testing new layouts, themes without the hassle of configuring a full-blown web server on your PC. You are just a command away to see how your site will look like!
You can write posts without the need to be online (OK, with the ubiquity of Internet connectivity nowadays this isn’t much of a strong argument), not to mention the potential of testing new layouts and writing posts in different branches in Git, without touching the live site.
Another advantage of Jekyll lies to its static nature; A page or a post in Jekyll is generated during build. In contrast, dynamic websites generate a post or a page during visit.
This of course induces a small delay of running the PHP script that connects to the database server, performs the appropriate queries to fetch the post and renders the HTML output during each visit.
Despite the fact that this delay is usually small (and sometimes negligible), it can increased when for instance the query on the database is taking a couple of seconds (either due to load on the database server or due to the fact that the database itself doesn’t have proper indexing on its tables).

Migration process

After reasoning about my choice on Jekyll, its time to perform the actual migration from Wordpress.
Jekyll has a built-in mechanism for the migration from various platforms. You can find more details on the jekyll-import documentation.
But first, lets create a Jekyll instance.

jekyll new myblog

This command will create the basic structure of a Jekyll site inside the directory myblog. If we just want to see it, just type;

jekyll serve 

The check the result at http://127.0.0.1:4000. It is just a simple site.
To perform the actual migration from my Wordpress, I used the “Export” option, located in My Site → Settings. For the lazy, just go to http://mysite.com/wp-admin/export.php .
This generates an XML file with the entire content of your site. It is widely used from migrations between Wordpress installations from different providers.
The import of your data to Jekyll, is performed using the following command.

ruby -rubygems -e 'require "jekyll-import";
    JekyllImport::Importers::WordpressDotCom.run({
      "source" => "wordpress.xml",
      "no_fetch_images" => false,
      "assets_folder" => "assets"
    })'

This eventually will parse wordpress.xml file that was exported from Wordpress, download any image contained on posts and save it to assets folder.
You can find more information in the Wordpress section of the documentation.
If no errors are presented, the _posts directory (the directory that contains the actual posts of your site), would have the following structure:

$ ls -l _posts
total 88
-rw-rw-r-- 1 aris aris  402 Dec  7 16:15 2013-11-29-hello-world-2.html
-rw-rw-r-- 1 aris aris 3756 Dec  7 16:15 2014-10-31-busybox-sagem-routers.html
-rw-rw-r-- 1 aris aris 4861 Dec  7 16:15 2016-01-26-migrating-to-qemu.html
-rw-rw-r-- 1 aris aris 3144 Dec  7 16:15 2016-06-28-disk-replacement-notes.html
-rw-rw-r-- 1 aris aris 2694 Dec  7 16:15 2016-07-05-a-simple-reminder-in-ubuntu.html
-rw-rw-r-- 1 aris aris 2114 Dec  7 16:15 2016-07-26-create-a-vm-with-virt-install-with-no-hassle.htm

As simple as that!

In this blog, I used the Jekyll Clean Dark theme from Pavel Makhov and just added my _posts director.
I performed a couple of minor modifications to the posts (e.g replaced <code> tags with Jekyll highlighting), and deployed the site to the server.
The site is currently served entirely from Nginx (hence leveraging HTTP/2) and its main page loads in slightly more that 1.5 seconds. Not so bad!

All things considered, I think that Jekyll suits me better. I can continue to use tools like git, vim etc. rather than visiting a page with an editor.
Nevertheless, I still do consider Wordpress as an excellent blog engine and CMS in general, but somehow it doesn’t suits me. But that’s just me!