Looking for detailed explanation of ghost cli update command

Hello I’m looking to understand the upgrade process, I’ve read the documentation but I can’t figure out how it works with the ghost update command.

I have deployed a docker based instance using the community docker image. The version deployed is v3.32 and I’m looking to upgrade to v3.33.

Given that the docker image does not invoke the ghost cli to do any upgrade, my question is: what does the ghost cli does behind the scene that I should be aware of so I can implement it in my docker deployment?

I hope a core maintainer can shed some light on this topic so we can potentially improve the documentation around this area. Thanks !

Hey @whollacsek :wave:

If you’re using docker, you just need to update the image to the latest version of the image. The CLI and Docker are kind-of 2 separate deployment methods :)

If you’re interested, you can see the stuff that the update command in the CLI Repository. Most of the stuff the CLI does for the update command is for the feature set provided by the CLI so it won’t apply to your docker deployment

Thanks for the quick response @vikaspotluri123.

I understood that docker deployment and cli deployment are 2 separate paths and the update command is updating the ghost source code. I guess my concerns are around the database migration, which the cli update command does run behind the scene (looking at the code). So my question becomes: is it necessary to run a database migration when upgrading the docker image? If so how should it be done?

There are 2 migrations referenced - CLI migrations, which don’t apply to Docker, and database migrations, which only run against older versions of Ghost:

            // CASE: We have moved the execution of knex-migrator into Ghost 2.0.0.
            //       If you are already on v2 or you update from v1 to v2, then skip the task.
            //       We compare the major versions, otherwise pre-releases won't match.

So the answer is no, you don’t need to manually run migrations :slight_smile:

Awesome!

Thanks for the clarification @vikaspotluri123