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
- Access your Docker host(s) through a user which was added to Docker user group
- Shutdown qTest
$ cd docker-deployment-x.x $ ./shutdown
- 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.
- 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
- Access your Docker host(s) through a user which was added to Docker user group
- 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
- 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
- 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
- Shutdown qTest
$ cd /usr/local/qtest-linux-7.3.7 $ ./qtest_shutdown.sh
- 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"
- 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
- 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
- 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
- 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
- Shutdown qTest Sessions
$ cd /usr/local/sessions-linux-2.2.3 $ bin/explorerd stop
- 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
- 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
- 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
- Backup Redis storage
The redis database file is located in /var/lib/redis/ - Backup Elasticsearch storage
Here are the summarize steps to backup Elasticsearch storage
- Create repository
- Snapshot all open indices
- 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
- 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
- Shutdown qTest
$ cd /usr/local/qtest-linux-7.3.7 $ ./qtest_shutdown.sh
- 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"
- 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
- 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
- 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
- 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
- Shutdown qTest Sessions
$ cd /usr/local/sessions-linux-2.2.3 $ bin/explorerd stop
- 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
- 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
- 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
- Restore Redis storage
Copy the backup redis database file to /var/lib/redis/ path. - 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
- Terminate qTest Service by openning Task Manager > Services > Look for the service named "qTestService", then right click on it and select Stop Service
- 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 databaseC:\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
- Execute backup with MySQL command with the detail instruction below
- Backup qTest attachment storage in the location listed in the element attachmentDirectory of qTest.config file
Windows Sessions Backup
- Terminate qTest Session Service by openning Task Manager > Services > Look for the service named "qTestSessionService", then right click on it and select Stop Service
- 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
- Execute backup with pg_dump command with the detail instruction
- Backup session storage in the location listed in the element storage of qtest-explorer-api.config file
- Backup Redis storage. The redis database file is located in C:\Program Files\Redis\data
- Backup Elasticsearch. Please refer the detail instruction here
Windows Manager Restore
Here are the databases required to be backup with MySQL:
- qtest
- poseidon
- Terminate qTest Service by openning Task Manager > Services > Look for the service named "qTestService", then right click on it and select Stop Service
- 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
- Copy the backup qTest attachment storage content to the location listed in the element attachmentDirectory of qTest.config file
Windows Sessions Restore
- Terminate qTest Session Service by openning Task Manager > Services > Look for the service named "qTestSessionService", then right click on it and select Stop Service
- 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
- Execute restore with pgsql command with the detail instruction
- Copy the backup qTest session storage content to the path listed in the element storage of qtest-explorer-api.config file
- Restore Redis storage: Copy the redis database file to C:\Program Files\Redis\data
- Backup Elasticsearch. Please refer the detail instruction here