Countly Documentation

Countly Resources

Here you'll find comprehensive guides to help you start working with Countly as quickly as possible.

Upgrading Countly server

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

Before upgrading to 18.08.1 from older versions

If you are on a version before 18.08 and would like to upgrade to 18.08.1, this section is for you. Additional 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 a strictly required, but highly recommended step as Countly uses some of the functions that come with MongoDB 3.6, which will increase speed to some extend.

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 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 steps and 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 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 17.09 with your new version):

bash bin/upgrade/17.09/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 last version (meaning, skipping version or more), then you will need to upgrade each version one by one as shown below.

For this, first you need to download 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 16.12 to 17.09, then you should do the following after extracting 17.09 package on top of 16.12:

bash bin/upgrade/17.05/upgrade.sh
bash bin/upgrade/17.09/upgrade.sh