Install a External Postgres such that the version of that postgres is currently in the series of inbuilt postgres of our Application. Say for example, In Servicedeskplus Application version 14010, which has postgres version 10.21, then you should install a external postgres server which has version in 10.x series <=10.21. We recommend to use Linux , for External Postgres Server machine instead of Windows.
Steps to Follow at the Postgres Server :
A. Start the External Postgres Server and open PSQL console. say in linux, you can start by invoking the below command
- sudo service postgresql start
- pg_lsclusters # To list out the available postgresql clusters
- sudo -u postgres psql # To enter into default postgres console with port number 5432 and postgres database
B. Create an user in the Server by executing the following commands.
If your postgres version is greater than or equal to 10,
- CREATE USER <username> WITH CREATEDB LOGIN REPLICATION ENCRYPTED PASSWORD <password>;
else,
- CREATE USER <username> WITH SUPERUSER CREATEDB LOGIN REPLICATION ENCRYPTED PASSWORD <password>;
\du # Lists the roles & users present in the External postgres server.
C. Create a database, which is going to configure in application and Navigate to that databse.
- CREATE DATABASE <database_name>;
- \c <database_name>
\l # Lists the databases available in the server
D. Execute the following commands to create a list of extensions.
- CREATE EXTENSION IF NOT EXISTS pg_trgm;
- CREATE EXTENSION IF NOT EXISTS pgcrypto;
- CREATE EXTENSION IF NOT EXISTS citext;
\dx # verifies whether the list of extensions created by listing it.
E. If the Application is running in a different server machine other than the external postgresql server machine(say incase of common database server), we need to configure Application machine address (machine where product is hosted) as mentioned below.
- In the External postgres server machine, open pg_hba.conf (references : pg_hba.conf , say in linux it is placed in /etc/postgresql/<version>/main)
- add the host row with "IP address of the Application machine/a CIDR mask length" to enable postgres server accept connection from Application as mentioned in the below example. you can also add
0.0.0.0/0
to enable access for all machines, but which is not recommended.
- host all all XX.XX.XX.XX/XX md5
- open pgsql\ext_conf\postgres_ext.conf file.
- add an entry listen_addresses= '<ip address(es)>' at the end of file.which Specifies the TCP/IP address(es) on which the External Postgres server is to listen for connections from Application. Similar to the host records, The special entry
*
corresponds to all available IP interfaces but which is not recommended.
- Note : It is not advised to modify the default postgresql.conf file bundled along with postgres database. All the configuration changes are to be done in file in ext_conf folder of postgres database.
- Restart the External Postgres Server.
Steps to follow at Product :
- Navigate to <prod_home>/ bin directory.
- Run changeDBServer.sh or chaneDBServer.bat , and configure the database, port, username and password.
- Navigate to <prod_home>/conf/ directory.
- Change the value of StartDBServer as "FALSE" in customer-config.xml.
- Start the Application.