06. Data Backup and Restore on CentOS/Ubuntu (non-Docker)

Before you begin

Please shut down qTest Manager and qTest Sessions

Back up data for qTest Manager

Restore data for qTest Manager

Back up data for qTest Manager

Back up databases

You will need to back up qTest Manager database and the integration (Poseidon) database following the steps below:

  1. To make sure that you back up the correct databases, access to the installation directory of qTest Manager. Open file qtest_env.sh and check out the dabase information which you will need to execute the command in step #2
    ...
    DB_HOST=[PostgreSQL server's host name or IP]
    DB_PORT=[PostgreSQL server's port]
    DB_USER=[username to log in to PostgreSQL]
    DB_PASSWD=[password to log in to Postgres]
    DB_NAME=[schema name of qTest database]
    ...
    POSEIDON_DB_HOST=[PostgreSQL server's host name or IP]
    POSEIDON_DB_PORT=[PostgreSQL server's port]
    POSEIDON_DB_USER=[username to log in to PostgreSQL]
    POSEIDON_DB_PASSWD=[password to log in to Postgres]
    POSEIDON_DB_NAME=[schema name of Poseidon database]
    		
  2. Access to the PosgreSQL server. Execute the following commands
    pg_dump --host=[DB_HOST] --port=[DB_PORT] --username=[DB_USER] --password --dbname=[DB_NAME] > [file_name].sql
    pg_dump --host=[POSEIDON_DB_HOST] --port=[POSEIDON_DB_PORT] --username=[POSEIDON_DB_USER] --password --dbname=[POSEIDON_DB_NAME] > [file_name].sql
    		

Back up attachments

Back up qTest Manager's attachments stored in the directory as defined in ATTACHMENT_DIR in qtest_env.sh file

Restore data for qTest Manager

You will need to restore data to qTest Manager database and the integration (Poseidon) database following the steps below:

  1. To make sure that you restore data to the correct databases, access to the installation directory of qTest Manager. Open file qtest_env.sh and check out the dabase information which you will need to execute the command in step #2
    ...
    DB_HOST=[PostgreSQL server's host name or IP]
    DB_PORT=[PostgreSQL server's port]
    DB_USER=[username to log in to PostgreSQL]
    DB_PASSWD=[password to log in to Postgres]
    DB_NAME=[schema name of qTest database]
    ...
    POSEIDON_DB_HOST=[PostgreSQL server's host name or IP]
    POSEIDON_DB_PORT=[PostgreSQL server's port]
    POSEIDON_DB_USER=[username to log in to PostgreSQL]
    POSEIDON_DB_PASSWD=[password to log in to Postgres]
    POSEIDON_DB_NAME=[schema name of Poseidon database]
    		
  2. Access to the PostgreSQL server. Use the backup files and execute the following command for both of the databases
    psql --host=[postgresql_host] --port=[postgresql_port] --username=[user] --password --dbname=[database_schema] < [backup_file].sql