How to Update Ghost CMS in Google Cloud Deploy with Bitnami?

Update ghost CMS is very easy and fast. just copy and paste some commands in the GCP SSH terminal.

How to Update Ghost CMS in Google Cloud Deploy with Bitnami?

My thought update ghost cms are very tricky for a new person. like me, you are a new or beginner in google cloud and deploy your ghost cms website help of bitnami. that time you face lots of trouble. You don't not under how to update my ghost cms without any error or problem. WordPress cms update with just one click but in Ghost CMS you use the command-line tool to update ghost cms.

If you beginner person you face some kind of afraid to run commands. sometimes you run the wrong command you lose your blog article data and face another issue in your ghost blog.

Bitanmi and Ghost CMS documentation are very good. but you are a beginner person you do not understand documentation. so in this article, I guide you step by step. how to update your ghost CMS without any Error. just follow me.

Note

You deploy Ghost CMS on Google cloud, and  AWS help of bitanmi, all the steps same. but I recommended the following official documentation.

Steps

  1. Upgrade Ghost 1.X Onwards
  2. Upgrade Ghost From 0.X To 1.X

Upgrade Ghost 1.X  Onwards

If your ghost CMS version above into 1.x. then follow these steps

  1. Change User
  2. Create Backup
  3. Update The Ghost-CLI
  4. Finally, update Ghost CMS


Change User

Firstly go to the google cloud console and open the instance secure ssh shell and log in as bitnami  user in ghost CMS.

sudo su bitnami
change User 
change user in gcp
change user in gcp

Create Backup

In ghost CMS two ways to create a backup.

  1. Using Dashboard
  2. Using Command-line ( Recommeneded ways)

Using Dashboard

Login to your ghost CMS dashboard after navigating the  “Settings" page and select the " Labs " section and click on the “Export” button. after few second you backup is starting to download in locally.

In this backup image not be included. you take  image backup also spartely.  you follow this path and take backup.

installdir/apps/ghost/htdocs/content/images
copy your images

You just copy or  move the images folder/directory to a new instance  directory for complete backup.

Using Command-line

Create your backup in ghost using the command line follow this article. choose your operating system and just paste command one by one your backup is created successfully.

Create and restore application backups
Article officially provided by the bitnami team.

Note

I'm recommended to use the command-line ways to create your backup. that is very easy ways to create backup. in this backup do not need download file in locally. you save backup on your gcp system.

Take backup use Dashboard, your backup is incomplete. in this backup image not be  download.


Update The Ghost-CLI

In ghost, you update ghost cms firstly update your Ghost CLI  in your project.

Firstly go to the lib folder in ghost using the cd command.

cd installdir/apps/ghost/lib
sudo npm install ghost-cli
Update ghost-cli
  • Replace the installdir placeholder with the full installation directory path of your Bitnami stack.
  • Only use sudo if the stack was installed as root.
update or install  ghost-cli
update or install ghost-cli

When you face any  warnings related to the package.json file during the update process. these warnings can safely be ignored

That time  your npm command fails. you just paste the command your problem was solved.

sudo mv package.json package.json.back
sudo npm install ghost-cli
sudo mv package.json.back package.json
If you face any waring to upadate ghost cli and then paste this command
  • Only use sudo if the stack was installed as root. ether wish you run the command without sudo.

Finally, update Ghost CMS

Finally, go to the ghost installation directory and execute the ghost update command.

Follow this steps

Step 1

In the step first, you got to the htdoc directory. following this command

cd installdir/apps/ghost/htdocs/
paste to go htdocs directory
change directory in ghost cms
change directory in ghost cms

Step 2

You go htdoc folder/directory run the ghost update command.

ghost update
ghost upadate command run in htdocs directory
  • Replace the installdir placeholder with the full installation directory path of your Bitnami stack.
Run Ghost update Command
Run Ghost update Command

Step 3

Your ghost installation finish. now modify file permissions

cd installdir/apps/ghost
sudo chown bitnami:daemon -R ./htdocs ./conf/ ./bin/
sudo find ./htdocs -type f -exec chmod 664 {} \;
sudo find ./htdocs -type d -exec chmod 775 {} \;
sudo chmod 640 ./htdocs/config.production.json
change file permission after ghost installation

Only use sudo if the stack was installed as root.

  • Replace the installdir placeholder with the full installation directory path of your Bitnami stack.
change file permission after ghost installation
change file permission after ghost installation

Congratulations! Now your ghost cms update.


Warnings

If you face this type of error. don't worry, i'm also face this error and i give you solution.

Error 1

bitnami@officialrajjdeepsinghblog-vm:/home/radewala_2/apps/ghost/htdocs$ ghost update
    ✔ Checking system Node.js version
    ℹ Ensuring user is not logged in as ghost user [skipped]
    ℹ Checking if logged in user is directory owner [skipped]
    ✔ Checking current folder permissions
    ✔ Checking memory availability
    ✔ Checking free space
    ✔ Checking for available migrations
    ✖ Checking for latest Ghost version
    A CliError occurred.
    Message: Unable to update Ghost directly to v4.2.0. You must be on the latest v3.x to update across major versions.
    Help: Run "ghost update v3" to get the latest v3.x version, then run "ghost update" to get to v4.
    Debug Information:
    OS: Debian GNU/Linux, v10
    Node Version: v12.19.0
    Ghost Version: 3.40.2
    Ghost-CLI Version: 1.16.3
    Environment: production
    Command: 'ghost update'
    Additional log info available in: /home/bitnami/.ghost/logs/ghost-cli-debug-2021-04-11T08_49_03_257Z.log
    Try running ghost doctor to check your system for known issues.
    You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.
Ghost Error

You face the same error as me. you just paste the ghost update v3 command in terminal your error was resolve.

Update ghost cms in google cloud use bitnam. now i face error?
The latest 3.x version is 3.42.4, you need to be on that version before you can upgrade to the latest 4.x version. The error is explaining you need to run ghost update v3 before ghost update. If you’re unable to run ghost update v3 please share the error message you are seeing when you run it.
Follow this Error in ghost fourm.

Error 2

Ghost theme warnings

Ghost update time.  you face theme warning message in your terminal. you just write y and  hit enter.after  your ghost installs successfully in GCP. after installing complete. you update ghost CMS theme manually. now your error was removed successfully.

Note

If you face any error related to ghost cms you just ask on the ghost official forum. ghost team and community of people guide you very easily.

Ghost Forum
Discussion about the professional open source publishing platform
Ghost cms official Disscussion forum

Upgrade Ghost From 0.X To 1.X

If you run a very old 0.x to 1.x version of ghost cms. now you update ghost cms very easily.

Follow my steps to update your ghost blog with the latest version.

Step 1

In this step, you create a backup using ghost dashboard UI.

Login to your ghost CMS dashboard after navigating the  “Settings" page and select the " Labs " section and click on the “Export” button. after few second you backup is starting to download in locally.

Note:

Your image or theme was not downloaded in your JSON backup file. if download your image just follow my step 4.

backup your ghost cms blog credit by bitnami
backup your ghost cms blog credit by bitnami

Step 2

Launch a brand new Bitnami ghost instance in GCP.

Step 3

Import your backup JSON file in your ghost dashboard.

Go to the settings page. click to the lab section and click to choose file. after selecting your ghost JSON backup file from your system. then click to import button.

Import your ghost cms Backup JSON file credit by bitnami

Step 4

Copy your image from the old Ghost instance directory to the brand new launch directory.

your all image save in this directory path

installdir/apps/ghost/htdocs/content/images
copy your images

You just move the images folder/directory to a new instance  directory.

installdir/apps/ghost/htdocs/current/content/images
move to image directory to a new instance
move to image directory to a new instance in ghost cms
move to image directory to a new instance in ghost cms

Step 5

Upload your theme in new ghost cms you just got to the setting page and click to design tab and click to upload a theme button. drag your file and click to update. by default, ghost cms provide Casper theme.

Now your ghost CMS fully migrated to the new Ghost Version. Congratulation


Reference

Upgrade Ghost
official bitnami docs update ghost cms
Update the Ghost CLI
official bitnami docs for ghost CLI
Create and restore application backups
official bitnami docs for backup
Ghost Docs
Everything you need to know about working with the Ghost professional publishing platform.
official ghost cms docs for ghost update
Ghost Forum
Discussion about the professional open source publishing platform
ghost cms official Disscussion forum

Conclusion

The ghost Cms update process very difficult for a beginner person. all ways run these command you make sure take backup of your Ghost CMS using command-line. you take backup use ghost dashboard you do not take an image backup. In this backup, you save only post data and ghost CMS settings and images not be included make sure.