Moving report and uaa databases to a new database cluster for on-premise deployment

Modified on Fri, 20 Oct, 2023 at 7:53 AM

Step 1

Create a backup of the database using pg_dump:

  1. Open the command prompt or terminal on the server with the source PostgreSQL cluster.
  2. Run the following command to create a backup of the database. Replace dbname with the name of your database and dumpfile.sql with the name of the file where you want to save the backup.
pg_dump -U username -d dbname -f dumpfile.sql

Replace username with the username of the database in the -U username parameter. Replace dbname with the name of your database in the -d dbname parameter. Replace dumpfile.sql with the path and name of the backup file in the -f dumpfile.sql parameter. 3. Enter the password of the database user if prompted.

Step 2

Transfer the backup file to the server with the new cluster:

  1. Copy the backup file (dumpfile.sql) to the server with the new PostgreSQL cluster using file transfer tools such as scp, rsync, or any other convenient method.

Step 3

Restore the created dump.

First, you need to create databases and users, and provide all the required grants for the users as described here: https://docs.qameta.io/allure-testops/faq/ext-db/#creating-the-databases


Restore the database using pg_restore:

  1. Open the command prompt or terminal on the server with the new PostgreSQL cluster.
  2. Run the following command to restore the database from the backup.
pg_restore -U username -d newdb dumpfile.sql

Replace username with the username of the database in the -U username parameter. Replace newdb with the name of the new database in the -d newdb parameter. Specify the correct backup file name in the dumpfile.sql parameter. 3. Enter the password of the database user if prompted.

After completing this process, your database will be restored on the new PostgreSQL cluster.

Make sure that all applications and settings related to the database are also transferred to the new server.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article