testgrinder
Go to testgrinder
  • Overview
  • testgrinder uses
    • Testing
      • User Acceptance Testing
      • Change Testing
      • Regression Testing
      • Performance Testing
      • Stress Testing
    • Data management
      • Data verification
    • Configuration management
    • Training videos development
  • Getting Started
    • Video: Get Started with testgrinder
    • First steps
    • Example Scripts
    • Writing your first scenario
    • Scenarios
    • Run reports
  • Writing Scenarios
    • Anatomy of Maximo UI
      • Maximo login page
      • Start Center
      • Application Screen
      • Value lists
      • Advanced Search
      • Targeting fields with no labels
    • Finding the right steps
    • Step autocompletion
    • Scenarios vs Scenario Outlines
    • Snippets and Templates
      • testgrinder Templates Project
      • testgrinder Snippets Project
  • Examples
    • Interacting with electronic signature dialog
    • Automated granting of application access
    • Add a job plan
    • Add an item
    • Add an item to storeroom
  • Administration
    • Accessing Maximo behind a firewall
    • Managing User Access
    • Using Git to Back Up and Version Control testgrinder Projects
  • Self Managed Private Cloud (SMPC)
    • testgrinder SaaS vs testgrinder SMPC
    • Releases
      • Version 1.0.8
      • Version 1.0.0
    • testgrinder Architecture
    • testgrinder Configuration
      • Configuration Files
      • Database Stored Settings
    • Deployment Instructions
      • Prerequisites
      • Subscribing to testgrinder on AWS Marketplace
      • Virtual Private Cloud
      • Security Groups
      • S3 Buckets
      • IAM Roles
      • Key Pair
      • Launch tg-app
      • Finalize Configuration File .env
      • Finalizing Database Stored Settings
      • Minimal Deployment Complete
      • Install SSL Certificate
      • Force HTTP to HTTPS
      • External Database
      • Configure Auto Scaling Group
        • Target Groups
        • Load Balancers
        • Launch Template
        • Auto Scaling Group
        • Finalize Auto Scale Group Deployment
    • Test the Deployment
    • Monitoring
    • Backup and Restore Database
Powered by GitBook
On this page
  • testgrinder service will be discontinued on January 31, 2025
  • testgrinder SMPC was discontinued as of February 1, 2024
  • Backup
  • Restore
  • Copy Database

Was this helpful?

  1. Self Managed Private Cloud (SMPC)

Backup and Restore Database

PreviousMonitoring

Last updated 1 year ago

Was this helpful?

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:

$ ssh ubuntu@my-tg-app
$ sudo su - testgrinder

List contents of the tg-app/config/provision/.env and note the database URI (the value of the MONGODB_URI setting).

$ cat tg-app/config/provision/.env

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 command to export the database into a gzipped archive file tg-app-db.gz:

$ mongodump --uri="mongodb://127.0.0.1:27017/tg_app_production" --gzip --archive='tg-app-db.gz'

You may test the generated file for integrity:

$ gzip -t -v tg-app-db.tgz 
tg-app-db.tgz:	 OK

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:

$ ssh ubuntu@my-tg-app
$ sudo su - testgrinder

List contents of the tg-app/config/provision/.env and note the database URI (the value of the MONGODB_URI setting).

$ cat tg-app/config/provision/.env

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

The existing database will be dropped and recreated from the backup file. All data stored in the database will be irrevocably lost.

$ mongorestore --uri="mongodb://127.0.0.1:27017/tg_app_production" --drop --gzip --archive='tg-app-db.gz'
...
2022-11-17T14:05:21.445-0500	28 document(s) restored successfully. 0 document(s) failed to restore.

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.

Run command to restore the database from the backup file (tg-app-db.gz here):

mongodump
mongorestore