Today marks my 2nd day with Ghost 😘 I spent nearly a whole night yesterday trying to figure out how to migrate from my current Jekyll site (hosted under Github pages). All my technical notes are stored there; I did think about moving my wordpress.com content over, but that's another story (I used to write a post about how to effectively extract information from WXR. In Chinese though). Nonetheless, it turned out to be a much challenging task.

current site
My current Jekyll site. Simple yet powerful.

I have a good starting point: the unofficial plugin recommended on the migration guide. However, the script is seriously outdated (last updated 5 years ago); it's not surprising to find that it failed in multiple places.

Challenge 1: Run jekyll build

This is for Windows 10 user only. As a ThinkPad user I really don't want to compromise and install Jekyll using some tricks. The official Jekyll docs provide another way out: using bash.

Challenge 2: undefined method getConverterImpl'`

This method seems to be deprecated after Jekyll 1.4.1 (this) is the last reference I've found); the alternative is to manually update this line to be find_converter_instance (source).

Challenge 3: Import error

See the screenshot below. I also noticed people reporting the same issue on the forum (not Jekyll, but we have the same symptom).

import error

Looks like the workaround is to grab a Ghost 1.0 site on a Docker image. I don't know how to use Docker yet (willing to learn) but really don't want to go through the setup again (partially because my local machine is not Linux/Mac 😂). So... I spent some time diving into the guide again, and found what elements were missing.

  • The fields required under post were changed. Especially the "mobiledoc" part.
  • Existing script does not include any author information, which might exist if the user has specified authors.xml under the _data folder (source).

Initially, I would like to write another script using my favoriate language (Python, yes) to further process the generated JSON. But then I realized why not just modify the ruby file directly? And, FYI, last time I ever wrote any line in Ruby was back in Fall 2017. I can still read the code (somehow) but had no confidence in writing. Yet, I made a way to enhance the plugin so that it works for Ghost 2.0 import, and you can find the code and how to use it under my repo.

And finally...

All my 8 posts were migrated successfully! Just a side note: when manually adding the author information, make sure that the slug field has the same slug as you set in your current dashboard. That way, Ghost will automatically link the current users with all imported posts.

my site now
My site now with the two sample imported posts.

I still need to update the script so that it knows how to extract author info from Jekyll. If you have an idea how to do so, please let me know (have been trying different combinations with no luck)! Happy blogging & coding 😀😀😀