Backup and Restore Database
testgrinder service will be discontinued on January 31, 2025
testgrinder SMPC was discontinued as of February 1, 2024
This page describes how to backup and/or restore testgrinder database. Combining backup and restore can be used to transfer the database from one instance of testgrinder to another.
Backup
Follow these steps to backup testgrinder database. The generated backup file can be used to Restore the database for the same testgrinder instance or to copy it to another.
Some data stored in the database is encrypted using keys specified in Configuration Files on tg-app instances. It is recommended to convert the configuration files into User Data format as described in Configuration Files and store the User Data along with the database backup file in a safe place.
ssh to the tg-app server and switch to testgrinder user:
List contents of the tg-app/config/provision/.env and note the database URI (the value of the MONGODB_URI setting).
The MONGODB_URI setting is set to mongodb://127.0.0.1:27017/tg_app_production if you are using the preinstalled MongoDB on tg-app
Run mongodump command to export the database into a gzipped archive file tg-app-db.gz:
You may test the generated file for integrity:
Copy the generated tg-app-db.gz file off the tg-app instance for safekeeping.
Restore
Follow these steps to restore the testgrinder database from a backup file produced by the Backup steps.
Copy the backup file you intend to restore to the tg-app instance.
ssh to the tg-app server and switch to testgrinder user:
List contents of the tg-app/config/provision/.env and note the database URI (the value of the MONGODB_URI setting).
The MONGODB_URI setting is set to mongodb://127.0.0.1:27017/tg_app_production if you are using the preinstalled MongoDB on tg-app
Run mongorestore command to restore the database from the backup file (tg-app-db.gz here):
The existing database will be dropped and recreated from the backup file. All data stored in the database will be irrevocably lost.
Restart all tg-app instances.
Copy Database
To copy testgrinder database from one instance to another, follow the Backup step on the source database, transfer the backup file to the target tg-app instance, and follow the Restore steps to restore.
Last updated