Share:

This help topic describes information on how to back up and restore PostgreSQL database. If you are using an Oracle database repository, please take assistance from your Oracle Database Administrator to take a backup of the Oracle repository.

The postgres user in the PostgreSQL database owns Postgres_Rep Repository.  PostgreSQL database runs on port 6065, but there is a connection pooling software called pgBouncer which is running at port 6075. The pgbouncer.ini file has the mapping between the database names which Datagaps uses in the connection string of the BI Validator Client and the actual database. You can find the pgbouncer.ini file in the <Install_Directory>\app\Datagaps\BIValidator\pgbouncer_1.8.1 folder.


Backup

The following script backs up Postgres_Rep database.
@echo on
REM The script sets environment variables helpful for PostgreSQL
@SET PATH="C:\>app\Datagaps\BIValidator\pgsql\bin";%PATH%
@SET PGUSER=postgres
@SET PGPASSWORD=postgres
@SET PGPORT=6065
@SET PGHOST=localhost
cd\
C: 
cd app\Datagaps\BIValidator\pgsql\bin
pg_dumpall -h localhost -p 6065 -U postgres -c -o -f "../../../postgresDump.sql"
exit

Restore

The following script restores Postgres_Rep repository. 

@echo on

REM The script sets environment variables helpful for PostgreSQL

@SET PATH="C:\>app\Datagaps\BIValidator\postgresql_10.3\bin";%PATH%

@SET PGUSER=postgres

@SET PGPASSWORD=postgres

@SET PGPORT=6065

@SET PGHOST=localhost

cd\

C:

cd "C:\app\Datagaps\BIValidator\pgsql\bin"

dropdb -U postgres -h localhost --if-exists Postgres_Rep

psql -f ../../../postgresDump.sql

TIMEOUT /T 100

exit

Information The backup and restore script exports the data into plain text format. This allows you to use the script into latest versions of postgreSQL.
PreviousNext

© Datagaps. All rights reserved.
Send feedback on this topic to Datagaps Support