This documentation gives you an overview on how to backup Countly server, including database, important configuration files, and directories.
Method 1: Traditional Mongo Command Line Utilities
In order to back up MongoDB database that Countly uses, change directory into a directory where you want your backup files to reside, and run
mongodump --db countly mongodump --db countly_drill
The commands above will create dump directory with your database data in it.
You can restore it by changing into the same directory where your backup is, and by running:
mongorestore --db countly ./dump/countly mongorestore --db countly_drill ./dump/countly_drill
Now we need to backup files that keep settings. You would need to preserve these files primarily if you modified them. If you haven't modified them and they are in their default, you do not have to backup those files as they come with all Countly installation.
Additionally you might want to backup some files that you usually add to countly, like:
frontend/express/public/appimages //uploaded app images frontend/express/public/userimages //uploaded user images frontend/express/certificates //push certificates
Method 2: Countly Command Line Utility
For general information about Countly command line utility, see this documentation
Backing up Countly via command line is easy - you just need to give the following commands:
countly backup /PATH/countly-backup
This will backup all Countly MongoDB files together with all configuration files, user images, and certificates (if any).
When you install a new server, and you have an old backup, this command will restore your old files on the new server:
countly restore /PATH/countly-backup
Any applications you have on the new server are kept, and apps which have been backed up previously will show up with their corresponding data.