How to Update Ghost CMS From 4.2.0 to 4.10.2

Introduction

Ghost is becoming the new WordPress. Upgrading your WordPress installation has become much easier and better now, with the option to update right away from the dashboard.

Upgrading Ghost is not so straight forward yet, but I am sure the team is working on it. This article explains the steps to upgrade your ghost installation to the latest version.

Step 1 - View the Current Version of Ghost CMS Installed

  1. Login to your Ghost CMS admin page as https://yourdomain/ghost with your admin credentials.
  2. In the Dashboard page, click on the user icon at the bottom left and select About Ghost.

The version details of your deployment will be visible in the About Ghost page.

The installed version is 4.2.0, and we will be upgrading to 4.10.2

Step 2 - Backup Posts and Settings

To back up your posts and other settings, Ghost provides an Export your content tool. This tool will export all your posts (including posts in Published, Drafts and Scheduled).

open the export tool by navigating to Settings -> Labs.

The Export button with download all of your posts and settings in a JSON file.

Step 3 - Backup content Directory

Themes and other contents like image are stored in the content directory. Usually ghost installation will be available in /var/www/<yoursite>/ folder.

Login as root or sudo user and backup the content folder.

cd /var/www/<yoursite>/
sudo tar -czvf content.tar.gz /var/www/<yoursite>/content/ 

This will create a back of contents folder in content.tar.gz file. Backup of posts and other files are not mandatory, but it is highly recommended to backup the file and content.

Step 4 - Update Ghost

To begin the update of Ghost, run ghost update. This will run a set of checks first to make sure the update will go through with out any issues.

ghost update

In case if you are facing any errors related to insufficient permissions like this, just follow the steps specified for each error and you should be good to go.

Message: Your user does not own the directory /var/www/<yoursite> and is also not a member of the owning group.
You must either log in with the user that owns the directory or add your user to the owning group.

Message: The directory /var/www/<yoursite> is not writable by your user. You must grant write access and try again.

Message: Your installation folder contains some directories or files with incorrect permissions:

Also, if the Ghost CLI complains about non-compatible version of ghost-cli like this,

You are running an outdated version of Ghost-CLI.
It is recommended that you upgrade before continuing.
Run `npm install -g ghost-cli@latest` to upgrade.

Just run,

sudo npm install -g ghost-cli@latest
Output:

+ ghost-cli@1.17.3
added 20 packages from 11 contributors, removed 7 packages, updated 31 packages and moved 3 packages in 11.379s

Once all errors are handled, run ghost update once again and relax.

+ sudo systemctl is-active ghost_debugfactor-com
✔ Checking system Node.js version - found v14.16.1
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking free space
✔ Checking for available migrations
✔ Checking for latest Ghost version

# 4.10.2

* 🐛 Fixed unsubscribed members receiving email when a post is sent to all members (#13181) - Kevin Ansfield

---

View the changelogs for full details:
* Ghost - https://github.com/tryghost/ghost/compare/v4.10.1...v4.10.2
* Admin - https://github.com/tryghost/admin/compare/v4.10.1...v4.10.2

✔ Fetched release notes
✔ Downloading and updating Ghost to v4.10.2
+ sudo systemctl stop ghost_debugfactor-com
✔ Stopping Ghost
✔ Linking latest Ghost and recording versions
+ sudo systemctl start ghost_debugfactor-com
✔ Restarting Ghost
ℹ Removing old Ghost versions [skipped]

Lets go back to ghost admin and check the version.

Conclusion

The latest version 4.x add some cool features like payment, and a nice dashboard. The membership component has got a lot better in Ghost 4.x and seems like this is where most of the teams energy went.

Upgrading Ghost still requires you to have some basic experience with linux, but going forward I am sure the update will be made much easier.

Asha

Asha

I am a self mentored web enthusiast who likes to inspect element everything I see on the web.