QMetry App DB Upgrade to MySQL v8.4.8 for 3 Tier Linux

Pre-requisites

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

Steps to upgrade to MySQL v8.4.8 DB Container

In case of Offline Installation

Follow the steps to download and restore the QMetry Database image.

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.

    image-20230824-041931.png
  2. Execute the following commands to download and save QMetry Database container image.

    docker pull qmetry/qmetry:appdb848
    docker images
    docker save -o qmetrydb.tar qmetry/qmetry:appdb848
    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
  2. Go to the directory where the qmetrydb.tar file is placed. Then execute the following command.

    docker load -i qmetrydb.tar
  3. Check whether the container images have been restored correctly or not.

    docker images
    image-20250102-100328.png

Steps to Upgrade QMetry App DB to MySQL 8.4.8

To upgrade QMetry App DB, do the following:

  1. Important: Backup your existing QMetry Database.

    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
    Example 12. 
    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.

  2. Stop the QMetry application. Go to the QMetry application server and run the following commands:

    docker stop <docker_name>
    Example 13. 
    docker stop qmetry_app_1


  3. Copy the QMetry_Linux_Installer.zip file to the server where the QMetry DB container is located. Navigate to the directory where this file is kept and run the following command.

    unzip QMetry_Linux_Installer.zip

    This process backs up data from the MySQL 8.0.33 container, creates a new MySQL 8.4.8 container, and restores the backup into it.

  4. Run the script.

    cd QMetry_Linux_Installer
    sudo su
    chmod +x upgrade.sh
    sh upgrade.sh
  5. At the online upgrade menu, type 1 to upgrade App DB.

    QMetry_Upgrade_Menu.png
  6. Next, the installation process prompts you with the following questions.

    Options

    Default Value

    Description

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

    Y

    Mention “N” for 3-tier.

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

    Y

    Mention “Y” for 3-tier.

    Enter the name of QMetry's database container

    qmetry_rds_1

    Enter the QMetry Database container name.

    Enter current Database Host

    -

    Enter Database Host Public IP/DNS of QMetry application.

    Enter current Database Port

    -

    Enter Database Port of QMetry application.

    Enter current Database User

    -

    Enter Database username of QMetry application.

    Enter current Database Password

    -

    Enter Database password of QMetry application.

    Enter current Database Schema

    -

    Enter Database schema name of QMetry application.

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 QMetry Upgrade Document (to latest version) 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.4.8 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.

Note

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 are facing any issues during the upgrade process, kindly generate a support ticket on the Support Portal for assistance.

Publication date: