How can I transfer bundled PostgreSQL to a remote PostgreSQL server?

How can I transfer bundled PostgreSQL to a remote PostgreSQL server?

Backup and restore the Applications Manager Database
  1. Create a backup of Applications Manager

    1. Shutdown Applications Manager.
    2. Connect to the bundled PostgreSQL database using the instructions provided here.
    3. 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).
    4. Once the backup is complete, connect to the remote PostgreSQL server using a terminal.
  2. Connect to a remote PostgreSQL server from Applications Manager

    1. Open the terminal and navigate to AppManageHome/working/pgsql/bin.
    2. Execute the following command to start the PostgreSQL server:
      Windows: pg_ctl.exe -D ../data/amdb start
      Linux: ./pg_ctl -D ../data/amdb start
    3. Once the database has started, execute the following command based on your operating system:
      Windowspsql.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.
    4. Create a new database in remote PGSQL using the command CREATE DATABASE amdb; .
    5. Switch to the new database using the command \c amdb;.
    6. 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?