How can I transfer bundled PostgreSQL to a remote PostgreSQL server?
Backup and restore the Applications Manager Database
Create a backup of Applications Manager
Shutdown Applications Manager.
- Connect to the bundled PostgreSQL database using the instructions provided here.
Execute the following pg_dump command to perform the backup:

pg_dump -U dbuser -h localhost -p<PORT> -d <DATABASE_NAME> -W -f BackupComplete_AMDB.sql --verbose 2> backupComplete_AMDB.log

<PORT> - This can be found in working\conf\database_params.conf . Search for the line jdbc:postgresql://localhost:15436/amdb? (15436 - value of the DB port).

<DATABASE_NAME> - This can be found in working\conf\database_params.conf . Search for the line jdbc:postgresql://localhost:15436/amdb? (amdb - name of the database).
Once the backup is complete, connect to the remote PostgreSQL server using a terminal.
Connect to a remote PostgreSQL server from Applications Manager
Open the terminal and navigate to AppManageHome/working/pgsql/bin.
Execute the following command to start the PostgreSQL server:

Windows: pg_ctl.exe -D ../data/amdb start

Linux: ./pg_ctl -D ../data/amdb start
Once the database has started, execute the following command based on your operating system:
Windows: psql.exe -p <DBPORT> -U <USERNAME> -h <REMOTE_PGSQL_HOSTNAME> -d postgres
Linux: ./psql -p <DBPORT> -U <USERNAME> -h <REMOTE_PGSQL_HOSTNAME> -d postgres
<DBPORT> : Port of the remote PostgreSQL server.
<USERNAME> : Username for remote PostgreSQL authentication.
<REMOTE_PGSQL_HOSTNAME> : Hostname or IP address of the remote PostgreSQL server.
Create a new database in remote PGSQL using the command CREATE DATABASE amdb; .
Switch to the new database using the command \c amdb;.
Execute the following command to restore the backup:

\i <path of the backup sql file>;

Example: \i /home/Master/APM/Builds_APM/171200/pgsql/bin/BackUpAMDB.sql;

The restoration time may vary depending on the connection between the remote PostgreSQL server and the Applications Manager host machine.
New to ADSelfService Plus?