Backing up and restoring a database on PostgreSQL
Back up and restore your PostgreSQL database with the Oracle Data Pump
technology.
- You have created a directory on your server machine to store all the exported files, such as .dump files.
- You have stopped Talend Data Catalog application server before performing the backup and restore tasks.
Backing up using the pg_dump command
- Open a command prompt window.
- Execute the following command to backup your PostgreSQL database into a
file:
pg_dump -b -f <backup_directory_path>\<backup_file_name> -F t -d "<db_name>" -h <postgre_host> -w -p <postgre_port> -U <postgre_username>
Restoring using the pg_restore command
- Open a command prompt window.
- Execute the following command to restore the file into the database server:
pg_restore -c -F t -d "<db_name>" -h <postgre_host> -w -p <postgre_port> -U <postgre_username> --if-exists <backup_directory_path>\<backup_file_name>
All the database objects and data are dropped before recreating them.
- Restart Talend Data Catalog application server.
- To ensure the optimal Talend Data Catalog application server performance, go to to run the database maintenance script.
- Right-click Run Database Maintenance and click Run operation now to update the database indexes and statistics.
For more information on the pg_dump and pg_restore commands, refer to the PostgreSQL documentation.