Updating Ghost Blog and fixing potential issues

Updating Ghost Blog and fixing potential issues

Recently, I updated one of my Ghost blogs from version 3 to version 4. Usually, this is a straightforward process, but I encountered a couple of issues. So I decided to note them down as well as solutions.

Before updating Ghost, always backup the current version of your blog!

Updating a Ghost Blog to the latest minor version

Updating a Ghost blog to a minor version is usually super easy.

1. First, update Ghost CLI:

sudo npm install -g ghost-cli@latest

2. Then update the blog itself:

ghost update

That's it. After running those two commands, the blog should be running and up to date.

Updating a Ghost Blog to the latest major version

The process is the same as upgrading to a minor version. Simply run the two commands I mentioned above. But before doing so, you need to verify a couple of things first.

Does my theme support the latest version of Ghost?

You can verify the theme with the GScan:

1. Download your theme from Settings:

  1. Settings -> 2. Design -> 3. Change theme -> 4. Advance -> 5. Download.

2. Upload it to the GScan.

GScan will verify your theme and report if there are any issues.

Does server run the supported version of Node?

When upgrading to the major version of Ghost, your server might be running the Node in the version that is no longer supported by Ghost.

In that case, we need to upgrade it:

1. Get the latest version of Node:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash]

2. Install newer version:

sudo apt-get install -y nodejs

3. Get the current Ghost version

ghost version

4. Reinstall current version of Ghost:

update [version] --force

Do I have enough memory?

If you are running Ghost on a machine with a limited amount of memory, you might not be able to update Ghost. In this case, you will get an error:

You are recommended to have at least 150 MB of memory available for smooth operation. It looks like you have ~74.265625 MB available.

You can check out how much memory you use by running:

 free -h

This command will print the memory usage, similar to this output:

             total       used      free       shared     buff/cache   available
Mem:          985M       497M       90M         1.2M           397M        342M
Swap:           0B         0B        0B

Usually, Ghost is taking all that memory, so to release it, just restart Ghost:

ghost restart

That's it folks. If you need more information about Ghost update process, check out official documentation.


Comments

Anything interesting to share? Write a comment.