PRE-REQUISITE: Make sure your QMetry Production instance and QMetry Staging instances are both on the same version.

Step 1 - Back up your QMetry Production database

Take the backup of your existing “qmetry” database. You can replace the username, password, location of the backup file (currently default /opt).

docker exec qmetry_rds_1 sh -c 'exec mysqldump -uroot -pqmetry --triggers --routines --hex-blob --single-transaction --lock-tables --no-create-db qmetry' > /opt/prod_db_backup.sql

Step 2 - Drop your existing Staging database and create a new empty database.

CAUTION - Make sure you are logged to your staging database server (not production) before proceeding.

Run the following commands one by one. Enter MySQL credentials when prompted.

sudo su
docker exec -it qmetry_rds_1 bash
mysql -uroot -p -A
DROP database qmetry;
DROP database qmetrycdc;
CREATE DATABASE qmetry CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
exit (to exit mysql)
exit (to exit mysql docker)

Step 3 - Restore the Production DB backup file on Stage

cat /opt/prod_db_backup.sql | docker exec -i qmetry_rds_1 mysql -uroot -p[password] qmetry

Wait for the restore to complete.

Step 4 - Follow the below steps after the DB Import is completed.

When you import the production DB to your stage server instance, it is required to perform the following mandatory steps to avoid the unnecessary issues with custom report stops working/keeps loading, post-import.

Make sure you run the following queries and perform the changes in the UI when you import the production DB to your stage instance :

  1. Execute the following queries on QMetry Stage App DB –

  2. Update QMetry Base URL, Reports Database, and Sync Configurations from the UI.

  3. Jira integrated QMetry projects need to be re-synced again.

For any questions or concerns, reach out to QMetry Support by sending an email to qtmprofessional@qmetrysupport.atlassian.net