Upgrading Countly server

Follow

Upgrading to the latest Countly Edition usually does not involve any complicated operations. However, you need to know which version you are upgrading to.

To get the latest Community Edition package, go to our Github repository.

To get the latest Enterprise Edition package, Login to our support system and go to the Enterprise package page. If you don't have an account there, you can sign up for one here.

Before upgrading to 20.11.X

Read before upgrading

Countly now supports only WiredTiger as a storage engine for MongoDB. Before upgrading make sure you are using WiredTiger as a storage engine and migrate your data if you are not.

Since Countly 20.11 release, supported MongoDB version changes to 4.4, and NodeJS version changes to 14.

Nodejs upgrade will be handled by the upgrade script itself, but since MongoDB can exist on separate servers, there are separate scripts to upgrade to MongoDB 4.4

You may upgrade the MongoDB version yourself or rely on the provided scripts to do the upgrade, but in case you have none standard settings or authentication, you might need to finish some steps manually

To upgrade MongoDB from 3.6 to 4.4 you will need to run the following scripts in this order:

  • bin/upgrade/20.11/upgrade.mongo.40.sh
  • bin/upgrade/20.11/upgrade.mongo.42.sh
  • bin/upgrade/20.11/upgrade.mongo.44.sh

You can use these MongoDB upgrade scripts also on separate MongoDB servers without Countly being installed there.

After that do Regular Upgrade by running the upgrade script bin/upgrade/20.11/upgrade.sh

Before upgrading to 19.X.X

Ensure you are running MongoDB 3.6.

If you are using Enterprise Edition, it includes Remote config plugin which uses new database countly_out. Make sure to add countly user to this database if you implemented authentication in your database.

After that, continue with Regular Upgrade by running the upgrade script bin/upgrade/19.02/upgrade.sh

Before upgrading to 18.08.X from an older version

If you are on a version before 18.08 and would like to upgrade to 18.08.X, this section is for you. In addition to regular upgrade, there are 4 optional scripts to run, depending on your system state, before running regular upgrade scripts mentioned below.

Optional step 1: Upgrading MongoDB

We have now upgraded our current supported MongoDB version to MongoDB 3.6. Hence, if you are on MongoDB 3.2, you may want to upgrade to MongoDB 3.4, and then to MongoDB 3.6, step by step, and need to set feature compatibility in between. This is not strictly required, but is a highly recommended step as Countly uses some of the functions that come with MongoDB 3.6, which will increase speed to some extent.

You can use automated script: bin/upgrade/18.08/upgrade.mongo.sh to upgrade MongoDB automatically, but if you have non default installation or modifications like authentication or some other limiting capabilities, it is suggested to go through the upgrade process manually.

Manual upgrade

For Manual upgrade, if you are using MongoDB older than 3.2, you will need to upgrade to MongoDB 3.2 first.

If you already have MongoDB 3.2, you will need to run the following script after you extract Countly 18.08 package onto the old Countly directory and run default upgrade.

This will first deploy MongoDB 3.4 and then MongoDB 3.6, one step at a time.

#change to countly directory
cd `countly dir`

#upgrade to 3.4
bash bin/upgrade/18.08/upgrade.mongo.34.sh

#set feature compatability to 3.4
mongo admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.4\" } )"

#upgrade to 3.6
bash bin/upgrade/18.08/upgrade.mongo.36.sh

#set feature compatability to 3.6
mongo admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.6\" } )"

If you are on MongoDB 3.4 already, then skip the above steps and follow the below to upgrade to feature compatibility 3.4 and then to MongoDB 3.6. After that, your database is upgraded:

#set feature compatability to 3.4
mongo admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.4\" } )"

#upgrade to 3.6
bash bin/upgrade/18.08/upgrade.mongo.36.sh

#set feature compatability to 3.6
mongo admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.6\" } )"

Optional step 2: Modify MongoDB Authentication

Note: Before running this step, make sure you have extracted Countly 18.08 onto the old Countly directory.

If you have authentication enabled for your MongoDB database, you also need to add countly_fs database to be authenticated with the same username and password as countly database.

Follow these instructions for more information.

Optional step 3: NodeJS version upgrade

Note: Before running this step, make sure you have extracted Countly 18.08 onto the old Countly directory.

New required Nodejs version is Nodejs 8+. Upgrade script should install it automatically, however, if you use another third party Nodejs version manager, you would need to update it manually to make sure new Countly service uses Nodejs 8+.

Optional step 4: Cleaning old push collections

Note: Before running this step, make sure you have extracted Countly 18.08 onto the old Countly directory.

Additionally, if you used push notifications a lot (e.g for millions of users), you may want to clear old collections, which are not used any more. You can do this by running the following script, after deploying Countly 18.08:

#change to countly directory
cd `countly dir`

#remove push collections
nodejs bin/upgrade/18.01.1/scripts/push_clear.js

Try removing those collections when server has the most resources (i.e not during peak time).

Now, you can move forward with Regular Upgrade below.

Regular upgrade

If you are going to upgrade from a previous version (e.g 16.06 to 16.12), things are simple - just follow the path below. If there are more than two versions that you need to upgrade (e.g from 16.02 to 16.12), then please see Skipping versions when upgrading section below.

  1. Download Countly and extract contents over current Countly directory, overwriting all existing files

  2. Check if there is an upgrade folder for that specific version in bin/upgrade. If there is an upgrade.sh script, then run it, just like the example below (replace 19.02 with your new version):

bash bin/upgrade/19.02/upgrade.sh
  1. If there is no such directory and upgrade.sh script inside that directory, then simply run:
#do upgrade files and restart countly
countly upgrade

Skipping versions when upgrading

If you are going to upgrade from a version that was released before the last version (meaning, skipping version or more), then you will need to upgrade each version one by one as shown below.

For this, you first need to download the latest release and extract it on your current Countly installation and then go to countly/bin/upgrade folder and execute all consecutive upgrade scripts.

Example: If you upgrade from 18.04 to 19.02, then you should do the following after extracting 19.02 package on top of 18.04:

bash bin/upgrade/18.08/upgrade.sh
bash bin/upgrade/19.02/upgrade.sh

Upgrading from Community Edition to Enterprise Edition

Countly CLI is already able to upgrade from Community Edition to Enterprise Edition. You can follow this procedure to complete process:

cd `countly dir`/../
(download enterprise edition package which is provided by us)
countly upgrade ee
Was this article helpful?
0 out of 0 found this helpful

Looking for help?