Upgrading Countly in Docker

Upgrading Docker-based Countly installations is slightly different from standard procedures. For obvious reasons, you will not need to download new sources, but the MongoDB version upgrades (if any) and data transformations will still need to be made. Therefore, upgrading procedures would appear as follows:

  1. Shut down the Countly containers.

  2. Go to Upgrading Countly server and check if any special procedures (like Nginx reconfiguration or MongoDB upgrade) must be made for the version you upgrade to. Perform the procedures if needed.

  3. Run the Countly data transformation scripts one-by-one for each version up you upgrade to. In the example below, we are upgrading from 19.08.1 to 20.04.

  4. Start the new Countly containers.

Please replace the images below with the one you use:

docker run -u root -e COUNTLY_PLUGINS="ACTUAL,PLUGIN,LIST" -e COUNTLY_CONFIG__MONGODB="mongodb://ACTUAL_MONGODB_URI/countly" countly/frontend:20.04 bash -c "/opt/countly/bin/docker/postinstall.sh; bash /opt/countly/bin/upgrade/20.04/upgrade_db.sh combined"

 

For the CentOS-based images earlier than 20.11.1, you'd also need to create a symlink (for the Enterprise Edition image):

docker run -u root -e COUNTLY_PLUGINS="ACTUAL,PLUGIN,LIST" -e COUNTLY_CONFIG__MONGODB="mongodb://ACTUAL_MONGODB_URI/countly" gcr.io/countly-01/centos-frontend:20.04 bash -c "/opt/countly/bin/docker/postinstall.sh; ln -s /opt/rh/rh-nodejs10/root/usr/bin/node /opt/rh/rh-nodejs10/root/usr/bin/nodejs; bash /opt/countly/bin/upgrade/20.04/upgrade_db.sh combined"  

Shutting down the Countly containers is not really necessary during most Countly upgrades, yet whenever you can shut them down, you should do so to ensure data consistency. In case shutting down the Countly containers is not an option for some reason, execute the db upgrades twice: before the first new container is launched and after the last new container is ready. This way you'll ensure the db transformations occurred for all the data, even the data being processed by the old containers when the new ones were still spinning up.

Was this page helpful?
Reach out to us for any other questions.
Helpful?

Looking for more Help?