Rolling back a QMetry application upgrade

You can roll back QMetry to its previous version if you encounter any issues during the upgrade. Any data changed since the last backup will not be present after rolling back.You can only rollback to the version that was before latest upgrade done.

Before you begin

Make sure you have the following backup, and access to the backup directories :

  1. QMetry database backup taken before starting the upgrade.
  2. Access to QMetry Application and Database docker

Rolling back the upgrade

To roll back an errorneous or a problematic upgrade, you simply need to restore the database from the backup and copy the root directory of the QMetry back to the webapps folder from the backup directory. Once that is done, upon restarting the MySQL and Tomcat Services in the same order gets you to the version before the upgrade.

  1. Stop the upgrade if the process is stuck, by hitting Ctrl + C.
  2. Stop the tomcat services by going inside the QMetry Application Docker : 
    • docker exec -it qmetry85_qtm_1 bash
    • cd bin
    • ./shutdown.sh
    • exit
  3. Restore the MySQL DB from the backup taken during the upgrade.
    • To restore the DB, the existing 'qmetry' db needs to be dropped. Login to MySQL DB and drop the existing DB.
      • CautionBefore performing this step ensure that you have a valid DB backup to restore your data from. Any data added in QMetry after this backup was taken cannot be restored.
        • docker exec -it qmetry85_mysql_1 bash
        • mysql -u[username] -p[password] qmetry -A
        • drop database qmetry;
    • Create a fresh blank (empty) DB using the following command :
      • CREATE DATABASE qmetry CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    • Restore the DB Backup .sql file as in below command :
      • Type \q to exit MySQL DB, and then exit to quit the MySQL docker.
      • Run the command by replacing the db backup sql file in this command : cat qmetry_backup_2019-01-01.sql | docker exec -i qmetry85_mysql_1 mysql -uroot -p'qmetry' 'qmetry'
      • Wait for the restore to complete.
  4. Restore the QMetry application from its backup directory. To perform this step get into QMetry Applcaition docker and run the following commands
    • docker exec -it qmetry85_qtm_1 bash
    • cd /home/qmetry/QMetry/backup
    • unzip ROOT.zip -d ROOT
    • cd /home/qmetry/QMetry/webapps/
    • rm -rf ROOT
    • mv /home/qmetry/QMetry/backup/ROOT /home/qmetry/QMetry/webapps/ROOT
    • exit
  5. Restart MySQL and Tomcat Services in the same order
    • Run command docker ps to view the available dockers
    • docker stop qmetry85_qtm_1 qmetry85_mysql_1 
    • docker start qmetry85_mysql_1 qmetry85_qtm_1

Your application and its data will be restored to the version before the upgrade.