Backup

Backup mongodb

Backup users (all users, not just for IMS).

mongodump --db admin --out ./backup/admin

Make a dump of the databases of the IMS. For each database, perform the operation as below, inserting the name of the database in place of $dbname:

mongodump --db $db-name --out ./backup/backup-$db-name

Restore

Restore the databases of the IMS. For each database, perform the operation as follows, inserting the name of the given database in place of $dbname

mongorestore --db $db-name ./backup/backup-$db-name

Recreate the users (all users, not just for IMS).

mongorestore --db admin ./backup/admin