Upgraded to Ghost 0.7

Hell yeah!

The blog is successfully upgraded to Ghost 0.7. This is my first time upgrading ghost blog version, so I had problems while doing that. Before explaining those fixes, let me start with how to upgrade. Every steps I mentioned below will be on SSH console.

  1. Make sure you stop the ghost process before upgrading the files, so that no processes are modifying files as they are overwritten.

service ghost stop

  1. Go to your ghost web directory.

cd /var/www/

  1. Use wget to download the lastest zip file of Ghost.

wget https://ghost.org/zip/ghost-0.7.0.zip

  1. Extract the files to the correct location to update the Ghost installation.

unzip -uo ghost*.zip -d ghost

The "-uo" options extract newer versions of files and create new files where necessary. DO NOT forget them or you may wipe out your information!

  1. And then, give control files for Ghost process.

chown -R ghost:ghost ghost/*

  1. Install new dependencies.

cd /var/www/ghost && npm install --production

  1. After everything is finished, you can start your ghost app.

service ghost start

If you are hosting in Digital Ocean, you can simply skip all these steps by using one command:

wget -O - https://allaboutghost.com/updateghost-digitalocean | sudo bash

Pretty Easy! Reload your page and enjoy. It means you don't need to read the following steps.

Now, it's about time for you to deal with errors after upgrading. You might see 502 Bad Gateway, and you have no idea about what is going wrong with your process.

I went to ghost directore cd /var/www/ghost and try starting ghost manually with npm start.

ERROR: Cannot find module '/var/www/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node'

This is the error you will be getting. I tried checking node_module folder and there is sqlite3 inside. I tried installing sqlite3 manually by npm install sqlite3. It seems works, but get another errors.

ERROR: undefined is not a function

So I realized that I need to remove every installed node modules and re-install again. And it works.

sudo service ghost stop && rm -rf node_modules && npm install --production && sudo service ghost start

Make sure you need to stop your ghost process for every single changes you will be doing in files. You can also restart after file changes, but this is for best practice.

Show Comments
Mastodon