Menu

Legacy Backup and Restore

This article provides instructions to backup and restore data for qTest Manager versions older than 8.1. For the latest backup and restore instructions: Backup and Restore.

Docker

Docker Backup

  1. Access your Docker host(s) through a user which was added to Docker user group
  2. Shutdown qTest
    $ cd docker-deployment-x.x
    $ ./shutdown
    
  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.

Docker Restore

  1. Access your Docker host(s) through a user which was added to Docker user group
  2. Run this command:
    $ cd docker-deployment-x.x
    $ ./shutdown
    $ ./restore yyyy-mm-dd
    
    • You can use yyyy-mm-dd to restore from a specific date when the backup file was created
    • If yyyy-mm-dd is omitted in the command, the most recent backup file will be restored by default
  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]
    

Linux (non-Docker)

Linux Manager Backup

Here are the databases required to be backup with MySQL using the integrated utility mysqldump:

  • qtest (the default database name)
  • poseidon
  1. Login as root on command shell of Linux server. Open the installation directory

    NOTE: These instructions provide scripts using the example where the base install directory is /usr/local and you are installing qtest-linux-7.3.7

  2. Shutdown qTest
    $ cd /usr/local/qtest-linux-7.3.7
    $ ./qtest_shutdown.sh
    
  3. Open qtest_env.conf file inside qTest directory to get database name
    $ vi qtest_env.sh
    

    Review the following information to connect to MySQL server: including host, port number, credentials and the schema name

    # MySQL external configuration variables. 
    MYSQL_PORT=[MySQL_Port] #eg: 3306 
    MYSQL_USER="[MySQL_User]" #eg: "root" 
    MYSQL_PASS="[Password_Of_MySQL_User]" #eg: "admin"
    MYSQL_HOSTNAME="[MySQL_Host]" #eg: "localhost" 
    #----------------------------------------------------------------------
    # POSEIDON SECTION
    #----------------------------------------------------------------------
    POSEIDON_DBNAME="poseidon"
    POSEIDON_DB_PORT="[MySQL_Port]"  #eg: 3306 
    POSEIDON_DB_HOST="[MySQL_Host]"  #eg: "root" 
    POSEIDON_DB_USER="[MySQL_User]"  #eg: "localhost"
    POSEIDON_DB_PASSWD="[mysql_password]"  #eg: "admin"
    
  4. Backup qTest database
    $ mysqldump --host=[MySQL's host] --user=root --password --routines --events --triggers qtest > qtestbackup.sql
    

    Eg:

    $ mysqldump --host=localhost --user=root --password --routines --events --triggers qtest > qtestbackup.sql
    

    It will backup all database of qtest (include routines / event / triggers) on non-docker linux package and save it as qtestbackup.sql file in your current directory

  5. Backup poseidon database
    $ mysqldump --host=[MySQL's host] --user=root --password --routines --events --triggers poseidon > poseidonbackup.sql
    

    Eg:

    $ mysqldump --host=localhost --user=root --password --routines --events --triggers poseidon > poseidonbackup.sql
    

    It will backup all databases of poseidon (include routines / event / triggers) on non-docker linux package and save it as poseidonbackup.sql file in your current directory

  6. Backup qTest attachment storage
    Open qtest_env.conf file inside qTest directory to get the attachment directory
    $ vi qtest_env.sh
    

    Backup the location listed in the variable ATTACHMENT_DIR

    # set OLD_ATTACHMENT_DIR point to old attachments folder. 
    ATTACHMENT_DIR=$QTEST_DIR/attachments #this directory needs to be writeable
    

Linux Sessions Backup

  1. Login as root on command shell of Linux server. Open the installation directory

    NOTE: These instructions provide scripts using the example where the base install directory is /usr/local and you are installing sessions-linux-2.2.3

  2. Shutdown qTest Sessions
    $ cd /usr/local/sessions-linux-2.2.3
    $ bin/explorerd stop
    
  3. Open configure.properties file inside qTest Sessions directory to get database name
    $ vi conf/configurer.properties
    

    Review the following information to connect to PostgreSQL server: including host, port number, credentials and the schema name

    # database configuration
    db.host=[PostgreSQL_IP_Address] //eg: 192.168.74.77
    db.port=[PostgreSQL_Port]  //eg: 5432
    db.user=[PostgreSQL_super_user] //eg: postgres
    db.password=[PostgreSQL_super_user_password]  //eg: postgres
    db.schema=[database_schema] //eg: sessions
    
  4. Backup qTest Session database
    $ pg_dump --host=[host] --username=[user] --password --dbname=[database_schema] > exportfile.sql

    Eg:

    $ pg_dump --host=192.168.74.77 --username=postgres --password --dbname=sessions > sessionsbackup.sql
    

    It will backup all database of sessions on non-docker linux package and save it as sessionsbackup.sql file in your current directory

  5. Backup Session storage
    Open configurer.properties file inside qTest directory to get the attachment directory
    $ vi conf/configurer.properties
    

    Backup the location listed in the variable storage.rootpath

    # storage configuration # storage.type suitable value (disk | s3 | riakcs)
    storage.type=disk
    # disk storage configuration 
    storage.rootPath=[Storage_Path_On_Local_Machine] //make sure that the directory is created before the installation
    
  6. Backup Redis storage
    The redis database file is located in /var/lib/redis/
  7. Backup Elasticsearch storage

    Here are the summarize steps to backup Elasticsearch storage

      1. Create repository
      2. Snapshot all open indices
      3. Backup this snapshot

    Please follow the instructions here

Linux Manager Restore

Here are the databases required to be restored with MySQL:

  • qtest (the default database name)
  • poseidon
  1. Login as root on command shell of Linux server. Open the installation directory

    NOTE: These instructions provide scripts using the example where the base install directory is /usr/local and you are installing qtest-linux-7.3.7

  2. Shutdown qTest
    $ cd /usr/local/qtest-linux-7.3.7
    $ ./qtest_shutdown.sh
    
  3. Open qtest_env.conf file inside qTest directory to get database name
    $ vi qtest_env.sh
    

    Review the following information to connect to MySQL server: including host, port number, credentials and the schema name

    # MySQL external configuration variables. 
    MYSQL_PORT=[MySQL_Port] #eg: 3306 
    MYSQL_USER="[MySQL_User]" #eg: "root" 
    MYSQL_PASS="[Password_Of_MySQL_User]" #eg: "admin"
    MYSQL_HOSTNAME="[MySQL_Host]" #eg: "localhost" 
    #----------------------------------------------------------------------
    # POSEIDON SECTION
    #----------------------------------------------------------------------
    POSEIDON_DBNAME="poseidon"
    POSEIDON_DB_PORT="[MySQL_Port]"  #eg: 3306 
    POSEIDON_DB_HOST="[MySQL_Host]"  #eg: "root" 
    POSEIDON_DB_USER="[MySQL_User]"  #eg: "localhost"
    POSEIDON_DB_PASSWD="[mysql_password]"  #eg: "admin"
    
  4. Restore qTest database
    $ mysql --host=[MySQL's host] --user=[user_name] --password --port=[mysql_port] --max_allowed_packet=128MB qtest < {path_to_qtest_backup}/qtestbackup.sql
    

    Eg:

    $ mysql --host=localhost --user=root --password --port=3306 --max_allowed_packet=128MB qtest < /usr/local/qtest-linux-7.3.7/qtestbackup.sql
    

    It will restore all data of qtest database (include routines / event / triggers) on non-docker linux package

  5. Restore poseidon database
    $ mysql --host=[MySQL's host] --user=[user_name] --password --port=[mysql_port] --max_allowed_packet=128MB --protocol="TCP" poseidon < {path_to_qtest_backup}/poseidonbackup.sql
    

    Eg:

    $  mysql --host=localhost --user=root --password --port=3306 --max_allowed_packet=128MB --protocol="TCP" poseidon < /usr/local/qtest-linux-7.3.7/poseidonbackup.sql
    

    It will restore all datas of poseidon database (include routines / event / triggers) on non-docker linux package

  6. Restore qTest attachment storage
    Open qtest_env.conf file inside qTest directory to get the attachment directory
    $ vi qtest_env.sh
    

    Copy the backup qTest attachment storage content to the path listed in the variable ATTACHMENT_DIR

    # set OLD_ATTACHMENT_DIR point to old attachments folder. 
    ATTACHMENT_DIR=$QTEST_DIR/attachments #this directory needs to be writeable
    

Linux Sessions Restore

  1. Login as root on command shell of Linux server. Open the installation directory

    NOTE: These instructions provide scripts using the example where the base install directory is /usr/local and you are installing sessions-linux-2.2.3

  2. Shutdown qTest Sessions
    $ cd /usr/local/sessions-linux-2.2.3
    $ bin/explorerd stop
    
  3. Open configure.properties file inside qTest Sessions directory to get database name
    $ vi conf/configurer.properties
    

    Review the following information to connect to PostgreSQL server: including host, port number, credentials and the schema name

    # database configuration
    db.host=[PostgreSQL_IP_Address] //eg: 192.168.74.77
    db.port=[PostgreSQL_Port]  //eg: 5432
    db.user=[PostgreSQL_super_user] //eg: postgres
    db.password=[PostgreSQL_super_user_password]  //eg: postgres
    db.schema=[database_schema] //eg: sessions
    
  4. Restore qTest Session database
    $psql --host=[host] --username=[user] --port=[port] --password --dbname=[database] < exportfile.sql

    Eg:

    $ psql --host=localhost --username=postgres --port=5432 --password --dbname=sessions < sessionsbackup.sql
    

    It will restore all data of sessions database on non-docker linux package

  5. Restore Session storage
    Open configurer.properties file inside qTest directory to get the attachment directory
    $ vi conf/configurer.properties
    

    Copy the backup qTest session storage content to the path listed in the variable storage.rootpath

    # storage configuration # storage.type suitable value (disk | s3 | riakcs)
    storage.type=disk
    # disk storage configuration 
    storage.rootPath=[Storage_Path_On_Local_Machine] //make sure that the directory is created before the installation
    
  6. Restore Redis storage
    Copy the backup redis database file to /var/lib/redis/ path.
  7. Restore Elasticsearch storage

    Restore the elasticsearch data from a snapshot. Please follow the instructions here

Windows

Windows Manager Backup

Here are the databases required to be backup with MySQL:

  • qtest
  • poseidon
  1. Terminate qTest Service by openning Task Manager > Services > Look for the service named "qTestService", then right click on it and select Stop Service

  2. Open qTest.config file inside qTest directory to get database name

    There are two options to backup qTest database

    • Execute backup with MySQL command with the detail instruction below
      Backup qtest database
    • C:\> mysqldump --host=[MySQL's host] --user=root --password --routines --events --triggers [qtest_databasename] > qtestbackup.sql
      

      Eg:

      C:\> mysqldump --host=localhost --user=root --password --routines --events --triggers qtestdb > qtestbackup.sql
      

      Backup poseidon database
      C:\Program Files\MySQL\MySQL Server 5.6\bin> mysqldump --host=[MySQL's host] --user=root --password --routines --events --triggers [poseidon_databasename] > poseidonbackup.sql
      

      Eg:

      C:\Program Files\MySQL\MySQL Server 5.6\bin> mysqldump --host=localhost --user=root --password --routines --events --triggers poseidondb > poseidonbackup.sql
      
    • Execute backup with MySQL Workbench

  3. Backup qTest attachment storage in the location listed in the element attachmentDirectory of qTest.config file

Windows Sessions Backup

  1. Terminate qTest Session Service by openning Task Manager > Services > Look for the service named "qTestSessionService", then right click on it and select Stop Service

  2. Open qtest-explorer-api.config file inside qTest Sessions directory to get database name

    There are two options to backup sessions database

      • Execute backup with pg_dump command with the detail instruction
        Backup session database
      • C:\Program Files\PostgreSQL\9.3\bin> pg_dump --host=[host] --username=[user] --password --dbname=[database_schema] > exportfile.sql

        Eg:

        C:\Program Files\PostgreSQL\9.3\bin> pg_dump --host=localhost --username=postgres --password --dbname=sessions > sessionsbackup.sql
        
      • Execute backup with PgAdmin Postgres Tools command with the detail instruction








  3. Backup session storage in the location listed in the element storage of qtest-explorer-api.config file
  4. Backup Redis storage. The redis database file is located in C:\Program Files\Redis\data
  5. Backup Elasticsearch. Please refer the detail instruction here

Windows Manager Restore

Here are the databases required to be backup with MySQL:

  • qtest
  • poseidon
  1. Terminate qTest Service by openning Task Manager > Services > Look for the service named "qTestService", then right click on it and select Stop Service

  2. Open qTest.config file inside qTest directory to get database name

    Restore qtest database

    C:\Program Files\MySQL\MySQL Server 5.6\bin> mysql --host=[MySQL's host] --user=root --password [qtest_databasename] < qtestbackup.sql
    

    Eg:

    C:\Program Files\MySQL\MySQL Server 5.6\bin> mysql --host=localhost --user=root --password qtestdb < qtestbackup.sql
    

    Restore poseidon database

    C:\Program Files\MySQL\MySQL Server 5.6\bin> mysql --host=[MySQL's host] --user=root --password [poseidon_databasename] < poseidonbackup.sql
    

    Eg:

    C:\Program Files\MySQL\MySQL Server 5.6\bin> mysql --host=localhost --user=root --password poseidondb < poseidonbackup.sql
  3. Copy the backup qTest attachment storage content to the location listed in the element attachmentDirectory of qTest.config file

Windows Sessions Restore

  1. Terminate qTest Session Service by openning Task Manager > Services > Look for the service named "qTestSessionService", then right click on it and select Stop Service

  2. Open qtest-explorer-api.config file inside qTest Sessions directory to get database name

    There are two options to restore session database

      • Execute restore with pgsql command with the detail instruction
        Restore session database
      • C:\Program Files\PostgreSQL\9.3\bin> pgsql --host=[host] --username=[user] --password --dbname=[database_schema] < exportfile.sql

        Eg:

        C:\Program Files\PostgreSQL\9.3\bin> pgsql --host=localhost --username=postgres --password --dbname=sessions < sessionsbackup.sql
        
      • Execute restore with PgAdmin Postgres Tools command with the detail instruction






  3. Copy the backup qTest session storage content to the path listed in the element storage of qtest-explorer-api.config file
  4. Restore Redis storage: Copy the redis database file to C:\Program Files\Redis\data
  5. Backup Elasticsearch. Please refer the detail instruction here
Subscribe To Our Blog
Powered by Zendesk