Menu

Backup and Restore

This article provides the latest instructions to backup and restore data of all qTest applications in your OnPremise environment. If your current version of Manager is 7.7.x or older, please see the older instructions instead: Legacy Backup and Restore.

Before you begin

  • Each application in the qTest platform store data in its own database, except qTest Launch which shares the same database with qTest Manager.
  • Some applications also store additional data on disk, e.g. qTest Manager stores attachments, qTest Sessions stores captured screenshots on local disk storage
  • You should backup data of all qTest applications, including, but not limited to databases and data files. This will ensure data consistency between applications if you restore the data at some point in the future

Shut Down All qTest Applications

Make sure you shut down all qTest applications before doing a backup or restore. This instruction assumes that you have installed every qTest application as one of the following:

  • a service on Windows environment
  • a service on Docker environment
  • a daemon on Linux environment

Dependent on your deployment model, you'll need to perform different steps to shutdown qTest applications.

Shutdown qTest Applications on Windows

Single Server Install on Windows

  1. Access to the Windows server where one or all qTest applications are installed.
  2. Open Services window.
  3. Look for a service named qtest and stop it.

Load Balancer Install on Windows

  1. Access to every server that you have installed a qTest application, e.g. qTest Manager, qTest Sessions, qTest Launch, qTest Insights, qTest Parameters, qTest Scenario/Pulse.
  2. Open Services window.
  3. Look for a service named qtest and stop it.

Shutdown qTest Applications on Linux (non Docker)

Single Server Install on Linux

  1. Access to the Linux server that you have installed qTest application(s), e.g. qTest Manager, qTest Sessions, qTest Launch, qTest Insights, qTest Parameters, qTest Scenario/Pulse.
  2. Open Terminal.
  3. Execute below command to stop qtest daemon:
    systemctl stop qtest

Load Balancer Install on Linux

  1. Access to every Linux server that you have installed a qTest application(s), e.g. qTest Manager, qTest Sessions, qTest Launch, qTest Insights, qTest Parameters, qTest Scenario/Pulse.
  2. Open Terminal.
  3. Execute below command to stop qtest daemon:
    systemctl stop qtest

Shutdown qTest Applications on Docker

Single Server Install on Docker

  1. Access a Docker host with a user which was added to Docker user group.
  2. Shutdown the Docker host.

Load Balancer Install on Docker

  1. Access to every Docker host with a user which was added to Docker user group.
  2. Shutdown the Docker host.

Backup and Restore qTest Manager and Sessions Data

NOTE: shut down all qTest applications before you begin.

Backup qTest Manager Database

    1. Access to the server where qTest Manager and Sessions is installed.
    2. Navigate to the installation directory of qTest Manager.
    3. Open file qtest.config. 
    4. Navigate to the postgres section. Collect the below information, in blue.
      external {
        postgres {
          host = '[IP or hostname of PostgreSQL server]'
          port = [PostgreSQL server port number]
      }
        auth {
          user = '[PostgreSQL username]'
          pass = '[PostgreSQL user password]'
        }
      db {
         qtest = '[Database name of qTest Manager]'
         sessions = '[Database name of qTest Sessions]'
        }
      ...

 

  1. Next, access to the PostgreSQL server.
    • If on Windows, open the Command Prompt as an Administrator. Access to the bin directory under your PostgreSQL's installation directory (eg: C:\Program Files\PostgreSQL\9.5\bin).
    • If on Linux you can just execute from any working directory because the binaries will be on PATH.
  2. Execute the following command to backup qTest Manager database and Sessions database.
  3. Replace text in the brackets with the information you collected in the previous step.
    pg_dump -h [IP or hostname of PostgreSQL server] -p [PostgreSQL server port number] -U [PostgreSQL username] --clean -d [Database name of qTest Manager] > qtestmanager_backup.sql
    pg_dump -h [IP or hostname of PostgreSQL server] -p [PostgreSQL server port number] -U [PostgreSQL username] --clean -d [Database name of Sessions] > qtestsessions_backup.sql        
  4. When being prompted for a password, enter the PostgreSQL user password you collected in the qtest.config file.

  5. Store these backups in a secure and remote location to be restored later.

Backup qTest Manager's Data Files

Back up qTest Manager's data files using the tar utility if on Linux, or the GUI if on Windows. The data is stored in the directory configured in qtest.config file, as shown below, in blue

external {
  manager {
    data = '[path to directory where data files are stored]'
  }
}

Backup qTest Sessions' Data Files

Back up qTest Sessions' data files using the tar utility if on Linux, or the GUI if on Windows. The data is stored in the directory configured in qtest.config file, as shown below, in blue

Note:

  • You only need to backup the qTest Sessions data files if the storage type is configured as disk_storage, and the data files that need to be backup is located in the path specified in the rootpath field.
  • If the storage type is configured to amazon_s3, follow the Amazon S3 instructions to backup qTest Sessions data
...
sessions {
storage {
// value must be in ['amazon_s3', 'disk_storage']
// * amazon_s3: stores resource files on amazon ec2
// * disk_storage: stores resource files on local disk
type = 'disk_storage'
...
rootpath = '/absolute/path/to/sessions/resources'
}
...
}

Restore qTest Manager and Sessions Data

NOTE: shut down all qTest applications before you begin.

Restore qTest Manager Database

  1. Access to the server where qTest Manager and Sessions is installed.
  2. Navigate to the installation directory of qTest Manager.
  3. Open file qtest.config. 
  4. Navigate to the postgres section. Collect the below information, in blue.
    external {
      postgres {
        host = '[IP or hostname of PostgreSQL server]'
        port = [PostgreSQL server port number]
    }
      auth {
        user = '[PostgreSQL username]'
        pass = '[PostgreSQL user password]'
      }
    db {
       qtest = '[Database name of qTest Manager]'
       sessions = '[Database name of qTest Sessions]'
      }
    ...
  5. Next, access to the PostgreSQL server.
    • If on Windows, open the Command Prompt as an Administrator. Access to the bin directory under your PostgreSQL's installation directory (eg: C:\Program Files\PostgreSQL\9.5\bin).
    • If you are on Linux you can run this from any directory in the shell, because the binaries will be on PATH.
  6. Execute the following command to restore qTest Manager database and Sessions database.
  7. Replace text in the brackets with the information you collected in the previous step.
    Note: replace text in the brackets with the information you collected from the previous step, replace [backup_file].sql with the path to the backup file.
    psql -h [IP or hostname of PostgeSQL server] -p [PostgreSQL server port number] -U [PostgreSQL username] -d [Database name of qTest Manager] < backup_file.sql 
  8. When being prompted for a password, enter the PostgreSQL user password you collected in the qtest.config file.

Restore qTest Manager data files

Next, restore the qTest Manager data files using tar if on Linux, or the GUI if on Windows, to the location defined in qtest.config file, as shown below, in blue.

external {
  manager {
    data = '[path to directory where data files are stored]'
  }
}

Backup and Restore qTest Data on Docker

NOTE: shut down all qTest applications before you begin.

Backup qTest Data on Docker

If you deploy qTest on multiple Docker hosts, please repeat the following steps on each host.

  1. Access a Docker host with a user which was added to Docker user group
  2. Make sure the backup command has executable permission.
    $ chmod +x ./backup
  3. Run the following command to create a backup file in the Docker Host.
    $ ./backup

    It will backup qTest on Docker host and save it as yyyy-mm-dd.tar.gz, in which yyyy-mm-dd is the date when the backup file was created.

  4. In case you want to backup and then download the backup file from the Docker host to your local machine, run this command
    $ ./backup pull	

    It will download yyyy-mm-dd.tar.gz, in which yyyy-mm-dd is the date when the backup file was created, to your current directory.

Restore qTest Data on Docker

If you deploy qTest Manager on multiple Docker hosts, please repeat the following steps for each host.

  1. Access a Docker host with a user which was added to Docker user group.
  2. Run the following command to restore data from a backup file.
    • You can use yyyy-mm-dd to restore from a specific date when the backup file was created.
    • If it is omitted, the latest backup file will be used.
    ./restore [yyyy-mm-dd]
  3. If you want to restore from a backup file which was downloaded to your local machine, run this command and pass in the file path.
    ./restore [path to yyyy-mm-dd.tar.gz]

Backup and Restore qTest Parameters and Pulse Data on MongoDB

NOTE: shut down all qTest applications before you begin.

Backup qTest Parameters and Pulse Database

  1. Access the server where qTest Parameters is installed.
  2. Navigate to the installation directory of qTest Parameters.
  3. Open file qtest.config and navigate to the mongo section.
  4. Collect the below information, in blue.
    external {
      mongo {
        host = '[IP or hostname of MongoDB Server]:[MongoDB Server Port]'
        replSet = '[replicaSet name]'
        auth {
          user = '[MongoDB username]'
          pass = '[MongoDB user password]'
          db = '[MongoDB authentication database name]'
          ssl = false
         }
      }
    }

  5. Next, access to the server where MongoDB is installed.
    • If on Windows, open the Command Prompt as an Administrator. Access to the bin directory under your MongoDB installation directory (eg: C:\Program Files\MongoDB\Server\3.4\bin).
    • If you are on Linux you can run this from any directory in the shell, because the binaries will be on PATH.
  6. Open the Command Prompt as an Administrator. Access to the bin directory under your MongoDB installation directory (eg: C:\Program Files\MongoDB\Server\3.4\bin).
  7. Execute the following command to backup qTest Sessions database. Note: replace text in the brackets with the information you collected from the previous step.
C:\Program Files\MongoDB\Server\3.4\bin>mongodump --host [replicaSet name]/[IP or hostname of MongoDB server]:[MongoDB Server Port] --authenticationDatabase [MongoDB authentication database name] --username [MongoDB username] --password [MongoDB user password] --db [qTest Parameters database name] --out [path to backup directory]
  • --host: specify MongoDB host name or IP address
  • --authenticationDatabase: specify MongoDB authentication database name. This is MongoDB's system database, default name is admin
  • --username: user name to authenticate with MongoDB
  • --db: specify qTest Parameters database name
    • qTest Parameters creates database in the run time if it does not exist, and default database name is nephele. If you changed the database name for some reason, make sure you use that database name as a value for --db parameter
    • qTest Pulse uses pulse as the default database name.
  • --out: specify a folder to store backup database

Example:

# mongodump --host rs0/10.0.10.113:27017 --authenticationDatabase admin --username tdm --db nephele --out "C:\backup"
# mongodump --host rs0/10.0.10.113:27017 --authenticationDatabase admin --username tdm --db pulse --out "C:\backup"

If the command is successful, the backup database will be stored in C:\backup\nephele and C:\backup\pulse folder. 

Restore qTest Parameters and Pulse Data on MongoDB

NOTE: shut down all qTest applications before you begin.

Restore qTest Parameters database

  1. Access the server where qTest Parameters is installed.
  2. Navigate to the installation directory of qTest Parameters.
  3. Open file qtest.config and navigate to the mongo section.
  4. Collect the below information, in blue.
    external {
      mongo {
        host = '[IP or hostname of MongoDB Server]:[MongoDB Server Port]'
        replSet = '[replicaSet name]'
        auth {
          user = '[MongoDB username]'
          pass = '[MongoDB user password]'
          db = '[MongoDB authentication database name]'
          ssl = false
         }
      }
    }

  5. Next, access to the server where MongoDB is installed.
    • If on Windows, open the Command Prompt as an Administrator. Access to the bin directory under your MongoDB installation directory (eg: C:\Program Files\MongoDB\Server\3.4\bin).
    • If you are on Linux you can run this from any directory in the shell, because the binaries will be on PATH.
  6. Execute the following command to restore qTest Parameters database.
    Note: replace text in the brackets with the information you collected from the previous step.
# mongorestore --host [replicaSet name]/[IP or hostname of MongoDB server]:[MongoDB Server Port] --authenticationDatabase [MongoDB authentication database name] --username [MongoDB username] --password [MongoDB user password] --db [qTest Parameters database name] [path to backup directory] --drop
  • --host: specify MongoDB host name or IP address
  • --authenticationDatabase: specify MongoDB authentication database name. This is MongoDB's system database, default name is admin
  • --username: user name to authenticate with MongoDB
  • --password: user password to authenticate with MongoDB
  • --db: specify qTest Parameters database name
    • qTest Parameters creates database in the run time if it does not exist, and default database name is nephele. If you changed the database name for some reason, make sure you use that database name as a value for --db parameter
    • qTest Pulse uses pulse as the default database name.

Example:

 # mongorestore --host rs0/10.0.10.113:27017 --authenticationDatabase admin --username tdm --db nephele "C:\backup\nephele" --drop

 

 # mongorestore --host rs0/10.0.10.113:27017 --authenticationDatabase admin --username tdm --db nephele "C:\backup\pulse" --drop

 

Your Mongo databases should now be restored.

Backup and Restore your entire qTest Deployment Directory

Do this on the Manager and Insights server. The reason this is done is that there may be custom configurations in your deployment that we will want to preserve in case of failure and in the event that we need to restore to a different server, we will have everything to make that transition as smooth as possible. Your Insights dashboards and saved reports are also going to be in this directory.

NOTE: shut down all qTest applications before you begin.

Back up qTest deployment files using the tar utility if on Linux, or the GUI if on Windows. The data is typically stored in the 'qtestctl' directory, or if it was renamed, the directory that contains the qtestctl script. 

 

Example to backup:

 # tar -zcvf name-of-archive.tar.gz -C /opt/qtest qtestctl

NOTE: The space must be between /opt/qtest and qtestctl so that it archives only the relative path.

Example to restore:

 # tar -zxvf name-of-archive.tar.gz -C /path/to/extract/qtestctl/archive

 

Once extracted, open the qtest.config and make sure that the hosts, URLs, and file locations match the hostname of the current server and the intended qTest data directories, update certificate locations as well if SSL certs are different for this host to avoid an invalid certificate error.

Startup All qTest Applications

Make sure you startup all qTest applications to verify that the restore was a success. This instruction assumes that you have installed every qTest application as one of the following:

  • a service on Windows environment
  • a service on Docker environment
  • a daemon on Linux environment

Dependent on your deployment model, you'll need to perform different steps to startup qTest applications.

Startup qTest applications on Windows

Single Server Install on Windows

  • Access to the Windows server where one or all qTest applications are installed
  • Open Services Windows
  • Look for a service named qtest and start it

Load Balancer Install on Windows

  • Access to every server that you have installed a qTest application, e.g. qTest Manager, qTest Sessions, qTest Launch, qTest Insights, qTest Parameters
  • Open Services window
  • Look for a service named qtest and start it

Startup qTest applications on Linux (non Docker)

Single Server Install on Linux

  1. Access to the Linux server that you have installed qTest application(s), e.g. qTest Manager, qTest Sessions, qTest Launch, qTest Insights, qTest Parameters
  2. Open Terminal
  3. Execute below command to stop qtest daemon:
    systemctl start qtest

Load Balancer Install on Linux

  1. Access to every Linux server that you have installed a qTest application(s), e.g. qTest Manager, qTest Sessions, qTest Launch, qTest Insights, qTest Parameters
  2. Open Terminal
  3. Execute below command to stop qtest daemon:
    systemctl start qtest

Startup qTest applications on Docker

Single Server Install on Docker

  1. Access a Docker host with a user which was added to Docker user group.
  2. Startup the Docker host.

Load Balancer Install on Docker

  1. Access to every Docker host with a user which was added to Docker user group.
  2. Startup the Docker host.

Verify qTest Application Functionality

To confirm that your restore was a success and to verify that application settings and functionality are correct, visit the qTest application URL in a supported browser, and login.

Verify the following:

  • System Configuration settings inside of the Administration Menu (e.g. Server Base URL, Application URLs, etc...)
  • Manager and Jira integration
  • Insights
  • Sessions
  • Parameters
  • Pulse 
  • Launch

Once all of the modules that apply have been tested and are stable then you have successfully completed the restore.

If you have any issues with the restore then please open a ticket with our support engineers to assist you.

 

Powered by Zendesk