How to backup and restore the Insight database


Insight database backups and restorations can be performed using mongodump and mongorestore. These should have automatically been installed when you installed the mongo database. Creating a database dump can impact performance of your running database so it is safer to wait for a time when you can shut insight down temporarily.

* Backing up the database *

Stop insight

=========================
[root]# systemctl stop insight
=========================

Create a backup of the Insight Mongo database and name the "dump" folder that will be created to something more meaningful.

=========================
[root]# mongodump -u insight_user -p 'changeme!' --db insight
[root]# mv dump mongo-db-backup-Feb_3_2020
========================

Restart insight

=========================
[root]# systemctl start insight
=========================


* Restoring the database from a backup *

Stop insight

=========================
[root]# systemctl stop insight
=========================

Restore the backup of the Insight Mongo database

=========================
[root]# mongorestore -u insight_user -p 'changeme!' -d insight ~/mongo-db-backup-Feb_3_2020/insight/
=========================

Start insight

=========================
[root]# systemctl start insight
=========================

Last update:
2020-05-18 20:43
Author:
Nate Seeley
Revision:
1.1
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.