Goodbye Ghost v0.11, Hello Ghost v2

Chai Jia Xun
a read

This is part of my mini Ghost series, where I document the problems I ran into during the migration and how I solved them. You can find the other posts at the bottom.


Last time I upgraded, it was 2 years ago. How time flies.

The greatest achievement I've had all year.

After not touching my blog for an entire year, I have finally bitten the bullet and upgraded the site to run the latest version of Ghost. Not surprisingly, the transition process was completely manual. Upgrading from a beta to the second major version was not a trivial task and performing an automated migration was simply not possible.

With that, I decided to start another ghost blog from scratch and manually copy all my posts over.

No surprises there.

Ghost underwent some major changes in the 2 years that I haven't touched it, and they are quite frankly amazing.

Setup process

The setup process was almost completely automatic. The new ghost-cli tool makes everything simple. Too simple in fact.

I was amazed that it automatically ran the ghost server and set up the nginx config, MySQL database and SSL certs. Unfortunately, that would probably mess with my existing configurations, so I ran ghost with some custom flags; an sqlite3 database, and I selected no for the setting up nginx prompt.

ghost install --db sqlite3

Yes I know that SQLite is a terrible idea for prod but who is even visiting my site anyway? It allows me to very quickly transfer my database from prod to dev while I tinker with the theme development.

The day I get more than 1 hit a month, I could easily migrate to a MySQL database.

Migration of posts

The posts themselves were easily pastable from the old markdown format. Most of the formatting was automatically set when I pasted my markdown posts. I had to perform a bit of formatting for each post, but nothing was too much effort.

What surprised me was how easy it was to migrate the images.

The file structure of the ghost remained fairly consistent from the beta so all I had to do was to rsync the images from the old ghost installation folder to the new one.

rsync -azP old_ghost/content/images/* ghost/content/images/

After that, pasting the markdown from my old site automatically included the images as well.

Theme

There's no avoiding this. I have to recode my theme from scratch. That's what I get for using a custom theme I suppose.

Theme development took as long as I expected, which was about 3 days of work. I started from a base theme and copied my old theme elements over. And while I was at it, I also took the liberty of finally adding some form of design to the homepage.

Old theme homepage
New theme homepage

The theme development was not as painful as I thought it would be. I also had not touched frontend code for a few months and this was a nice change of pace from database and react stuff.

The new theme had some cool new features like page scroll position as well as a default author's bio and length of read. The old blog simply had a hardcoded 15 min read tacked on to every single post.

Hardcoded values.

Overall this migration project took me around 2 weekends. From the decision to start the migration, to recoding the theme, to manually copying all my posts and reformatting them to the new blog.

I will be posting much more this year, and no, this is not a new year's resolution. The revival of the blog just happened to coincide with the new year.

P.S. In the time it took me to migrate to ghost v2.9.1, v2.10.1 was released. Thankfully, upgrades are now simply a ghost upgrade away.


Ghost Mini Series

Check the next post: Ghost: Updating image links after changing domains ยป

Share on:
Chai Jia Xun
Chai Jia Xun

Jia Xun speaks of himself in the third person when writing his bio. He thinks he's being cute but we all know that's just cliche. Being meta is so passe. Why do people still do it?