The hassles of updating Ghost
2 min read

The hassles of updating Ghost

If there's one thing I really miss about the Wordpress version of the blog was the ease of the updating process. While I do prefer Ghost for my blogging needs, I loathe the idea of having to upgrade it... However, version 0.7 of Ghost is so nice I just had to overcome my fears and finally upgrade this blog.

Having ran into many problems while upgrading my other blog, I was not very optimistic, but armed with patience and the experience of another upgrade, I went ahead with it.

In theory, the process of upgrading Ghost is rather easy, almost as easy as upgrading Wordpress manually. You overwrite some files, run npm install --production and then restart Ghost (NODE_ENV=production forever start index.js in my case). If only things were as simple.

There were two main motives of concern: first, I had problem with the sqlite3 module, almost like in this issue, and second, my processed kept getting Killed (it seems memory problems while upgrading Ghost are rather common).

After almost two hours of struggles, I reached the same conclusion as this guy: I kept getting random errors because I was running out of RAM.

Rebooting the server to forcefully free the memory didn't seem to work. I know, it's a very barbaric method but since we're talking about a small droplet for personal use, it wasn't a big problem. However, the clock was ticking and my blog was still in 502 error mode. I was running out of options and then it hit me: I simply need more memory!

The great thing about DigitalOcean is how easy you can scale when you need it. They have two options: a permanent resize and a flexible resize. The first one is irreversible and it takes more time, because it also gives you more server space, but the second one, the flexible resize, lets you increase the CPU and RAM for a limited amount of time and you can revert back to the original hosting plan when you're done.

There's just one catch, discovered after reading the docs since the first two resize attempts had no effect: you need to power off your droplet before resizing. After this, the process itself takes only a couple of seconds, maybe up to a minute.

With double of my previous amount of RAM, the upgrade process went smoothly and it only cost me literally a couple of cents more. I switched back to my original 5$ monthly hosting plan and now everything works perfectly!

DigitalOcean and Ghost are clearly a match made in Heaven! For everyone else running this combo, make sure to increase your resources before the upgrade and save yourselves some troubles.