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.
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
Go to your ghost web directory.
wgetto download the lastest zip file of Ghost.
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!
And then, give control files for Ghost process.
chown -R ghost:ghost ghost/*
Install new dependencies.
cd /var/www/ghost && npm install --production
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
ERROR: Cannot find module '/var/www/ghost/nodemodules/sqlite3/lib/binding/node-v14-linux-x64/nodesqlite3.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.