TR;DR
Assume that Growi is running on docker with the configuration below
| App | Version |
|---|---|
| Growi | 4.2.21 |
| mongodb | 3.6 |
There are major changes from Growi 4.3 onwards, so when you upgrade from 4.2 or earlier to 4.3, look through the official articles first
And be sure to take a backup before starting the work!
Updating mongodb
Up to Growi 4.2.x it could also run on mongodb 3.x, but 4.3 requires mongodb 4.4, so mongodb has to be updated
I did the work of updating mongodb in the order 3.6->4.0->4.2->4.4
$ docker-compose stopFix the mongo version specification below inside docker-compose.yml (3.6⇢4.0)
mongo:
image: mongo:4.0$ docker-compose up -d
$ docker exec -it growi_mongo_1 /bin/bash
# mongo
>db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )
#exit
$ exitRepeat this operation while changing the mongo version part. (The container name growi_mongo_1 differs depending on your own environment, so look it up and change it accordingly)
Note that after the version upgrade, once you have confirmed that it works, delete the old mongodb images you no longer need
Fixing the Dockerfile
Back up the current Dockerfile and swap it with the official Dockerfile on Github
If you have not modified the Dockerfile or docker-compose.yml heavily, git pull or git clone is fine as well
Upgrading to 4.3.x
After stopping Growi with docker-compose stop,
confirm that mongodb is 4.4 and that the Dockerfile is the latest one, then delete all the growi related image files (weseek/growi:4 alone may be enough)
$ docker rmi weseek/growi:4Rebuild and start it
$ docker-compose up -d --build
...
Recreating growi_elasticsearch_1 ... error
Starting growi_mariadb_1 ... done
Starting growi_mongo_1 ... done
2b1e0073aa599ce405cb150a843cd26a50d7a428be4314c1
Recreating growi_hackmd_1 ... error
ERROR: for growi_hackmd_1 no such image: sha256:9e2f64420f8260b1f3ebb61883e990838e95758c1e09ac0682ab0f8a4359ffe6: No such image: sha256:9e2f64420f8260b1f3ebb61883e990838e95758c1e09ac0682ab0f8a4359ffe6
ERROR: for elasticsearch no such image: sha256:e6e709e609d8bc902b1e0073aa599ce405cb150a843cd26a50d7a428be4314c1: No such image: sha256:e6e709e609d8bc902b1e0073aa599ce405cb150a843cd26a50d7a428be4314c1
ERROR: for hackmd no such image: sha256:9e2f64420f8260b1f3ebb61883e990838e95758c1e09ac0682ab0f8a4359ffe6: No such image: sha256:9e2f64420f8260b1f3ebb61883e990838e95758c1e09ac0682ab0f8a4359ffe6
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
Continue with the new image? [yN]y
...
Successfully tagged growi_app:latest
growi_mariadb_1 is up-to-date
growi_mongo_1 is up-to-date
Recreating c591aa1f77f1_growi_elasticsearch_1 ... done
Recreating c2df05b864c2_growi_hackmd_1 ... done
Recreating growi_app_1 ... donePerhaps because I deleted all the images, hackmd and elasticsearch were rebuilt, but it started up without any trouble