Thoughts on migrating from Pelican to Ghost blogging platform

Finally, it took me a whole day to do the full migration but I’m finally back. I’m very much glad that this is over; I shudder at the thought of having more than 400 posts and needing to migrate to other blog/CMS system as it’s a very ardeous task in general, and it shouldn’t be taken lightly either.

Thoughts on Pelican

To those who don’t know Pelican is a static site generator. Recently I posted a few days ago that static site generators sucks in general and it has much to do with the fact that it doesn’t solve anything. It devolves to the idea that just writing markup formats such as Markdown and Textile is okay rather than making a better blogging software. When it comes to managing your posts, updating them or adding assets it dawns on you that maybe it wasn’t a great idea.

Ghost isn’t so bad in the resource consumption department. I have set up nginx and both combined just works quite well. Personally? I didn’t want to deal with WordPress either.

Pelican documentation for users and developers isn’t that good. It made the whole migration harder as I had to poke through every little class to know what I’m dealing with. There is even a broken signal that should have sufficed for this export called all_generators_finalized; sadly I never got to use it because Pelican doesn’t recognize it.

Thus, all in all a simple task became a time sucker–although let be honest, programming in general is time consuming.


Thoughts on migrating from Pelican to Ghost blogging platform

My little script only exports articles right now. I guess I should say that I only created it out of need, not because there’s demand. The exporter will create a file in the folder you decided to place Pelican base folder, for example mine is in /home/david/Projects/websites/dgzen and that’s where Pelican runs and create all the necessary files for it to sync it to the server.

So using that path the json dump is created in /home/david/Projects/websites/dgzen/ghost_export/pelican2ghost.json. Not hard to find, huh?

After you get the generated json file it’s time to go to your Ghost installation, and go to the Labs section http://my-panini-blog/ghost/settings/labs/.

Import the data, and that’s it.

As for any migration you have to take care of your assets (images, archives, etc).

One of the nuisances of importing to Ghost is that it doesn’t really throw errors or anything. It’s pretty much a “YUMMY! DATA, MUCH MUNCH. YUM YUM!” and it does so in a way that it would throw this message:

Cannot call method ‘replace’ of undefined

I guess my first reaction was: “I wonder if Ghost’s import method is broken…?”

It ended up being the fact that it was lacking the markdown key in the “posts” collection. I guess I should be thankful for my gut feeling.

Ghost also has a very interesting bug that when you export everything is scrambled in the content page All posts side panel. One might think they are sorting by date…. I don’t know why it’s not sorted by date.

Moving on

That’s it from me. I haven’t changed Ghost themes yet. I feel “safer” that it’s using SQLite as its backend so I don’t have to deal with dozens of markdown files.

I’ll be uploading the script today on Github. I’ll post about it when it becomes available.