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?
Related Articles
How to use my own PostgreSQL instead of the PostgreSQL bundled with Applications Manager ?
Applications Manager v17 comes bundled with PostgreSQL 15 and Applications Manager v16 comes bundled with PostgreSQL 11. If you want to use your own PostgreSQL instead, follow the steps mentioned below : Prerequisites: A compatible PostgreSQL ...
How can I troubleshoot the issue when attempting to add a PostgreSQL Database server, but encountering a failure with an error message prompt?
While attempting to add a PostgreSQL database monitor, if you encounter any errors, please follow the steps below based on the specific error received: Host not valid. Kindly check the host name given or PostgreSQL production server is down or The ...
Steps to configure Azure PostgreSQL Database as Applications Manager's back-end
Applications Manager comes bundled with PostgreSQL. If you want to use your own PostgreSQL instead, follow the steps mentioned below: Prerequisites: A compatible PostgreSQL database should be accessible from Applications Manager installation. To know ...
I get "PostgreSQL initialize Failed" error in AppManagerHome\pgsqlerr.txt file during startup. How can I fix this ?
Error: FATAL: could not create semaphores: No space left on device DETAIL: Failed system call was semget(5440126, 17, 03600). Reason: The reason could either be that there was no disk space or there were too many PostgreSQL connections open. ...
I cannot add remote server monitor using SSH password authentication.
Please follow our suggestions below, 1) When adding that server monitor , please specify the correct command prompt value, which is the last character in your command prompt after connecting to that server with that appropriate username Connect to ...