QMetry Upgrade Document for 2 Tier (v8.15.0)

Steps to upgrade to MySQL v8.0.33 DB Container

Pre-requisite

  • Ensure that QMetry is not in use and there are no ongoing operations or traffic on QMetry.

Steps

→ In case of Offline Installation
Follow the steps to download and restore the QMetry Database image. After the image is successfully restored, you can then move forward with the next steps.

Download the Container Image of QMetry DB

Follow these steps on a machine where the internet is accessible so that the container images can be downloaded on it.

→ Steps to download the container image of the QMetry Database:

1. Execute the following command. Next, it will ask for container repository credentials. Enter the required credentials. If you do not have the credentials, please contact QMetry Support.

  • docker login

After entering container repository credentials, it will show the success message as shown below.

2. Execute the following commands to download and save QMetry Database container image.

  • docker pull qmetry/qmetry:appdb8

  • docker images

  • docker save -o qmetrydb.tar qmetry/qmetry:appdb8

  • ls

3. Transfer the qmetrydb.tar file to the host server.

 

Restore the Container Image of QMetry DB
Restore the container image of QMetry DB on the specific machine where the installation is to be carried out.

→ Steps to restore the container image of the QMetry Database:

1. If you are using the "root" user for installation, then execute the following command. If the user is other than the "root" user, skip this step.

  • sudo su

  1. Navigate to the directory where the qmetrydb.tar file is placed. Then execute the following command.

  • docker load -i qmetrydb.tar

  1. Execute the following command to check whether the container images have been restored correctly or not.

  • docker images

Step 1. IMPORTANT: Backup your existing QMetry Database

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

Syntax: docker exec qmetry_rds_1 sh -c 'exec mysqldump -uroot -p<password> --triggers --routines --hex-blob --single-transaction --lock-tables --no-create-db qmetry' > /opt/qmetry_backup_<date>.sql

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

Verify that your database has been backed up properly and is available for later use in case of any emergency.

Step 2. Extract QMetryDBUpgrade.zip.

Copy the QMetryDBUpgrade.zip file received from QMetry Support to the server where both the QMetry DB and Application container are located. Navigate to the directory where this file is kept, and execute the following command.

  • unzip QMetryDBUpgrade.zip

 

The following process will create a backup of the data from the MySQL 5.7.28 container. Next, a new container for the database will be set up, running on MySQL v8.0.33. Finally, the backed-up data will be restored into the new MySQL v8.0.33 container.

Step 3. Execute the following commands.

Next, the installation process will prompt you with the following questions.

Options

Default Value

Description

Options

Default Value

Description

Do you have QMetry's application container running on this machine? (Y/N)

Y

Mention “Y” for 2-tier upgrade.

Enter the name of QMetry application's container.

qmetry_app_1

Enter the QMetry application container name.

Do you have QMetry's database container running on this machine? (Y/N)

Y

Mention “Y” for 2-tier upgrade.

Enter the name of QMetry's database container

qmetry_rds_1

Enter the QMetry Database container name.

Note: This process may take time depending on the amount of data in the database.

Steps to upgrade QMetry to the latest version

Follow the document https://qmetrysupport.atlassian.net/wiki/spaces/QTMSv815/pages/3414830135 to upgrade to the latest version.

Clean up data from MySQL 5.7.28 container

Refer to this section only after performing the steps mentioned in the Steps to upgrade to MySQL v8.0.33 DB Container and Steps to upgrade QMetry to the latest version sections above.

This is an optional step to perform, but we recommend you follow it in order to clean up the residual components and, hence, free up some disk space on the server.

The old QMetry database container and all associated data will be permanently removed once you perform these clean up steps. This action is irreversible.

Before you begin, ensure that the QMetry upgrade is successful, and the data has been fully restored. Once everything has started functioning properly, only then proceed with these steps.

 

Cleanup Commands:
Execute the following commands on the server where the QMetry DB container is located.

  • docker rm qmetry_rds_1

  • docker volume rm $(docker volume ls -qf dangling=true)

  • docker image prune -af

 

If you encounter any issues during the migration process, please generate a support ticket on the Support Portal for assistance.