# Removing the PostgreSQL High Availability Setup with Secondary Server and Read-Only Server Continuity This help document explains how to remove the High Availability (HA) setup configured using PostgreSQL. Based on your deployment model, follow the appropriate steps to remove either the Secondary Server or the Read-Only (RO) Server configuration. 1. [Removing the Secondary Server Configuration](https://www.manageengine.com/privileged-access-management/help/remove-high-availability-setup-postgresql.html#Removing_the_Secondary_Server_Configuration) 2. [Removing the RO Server Configuration](https://www.manageengine.com/privileged-access-management/help/remove-high-availability-setup-postgresql.html#Removing_the_RO_Server_Configuration) ## 1. Removing the Secondary Server Uninstall the PAM360 application from the configured secondary server, and then follow the steps below on the primary server: 1. Stop the PAM360 service. 2. Open the command prompt, navigate to the **/bin** folder, and execute the following command based on your operating system: - **Windows** ```bat DeleteAppServer.bat ``` - **Linux** ```bash sh DeleteAppServer.sh ``` 3. Execute the following command with administrator/root (sudo) privileges, depending on your operating system: - **Windows** ```bat unregister_pgdbservice.bat ``` - **Linux** ```bash sh unregister_pgdbservice.sh ``` 4. Navigate to the **/conf** folder, open the **customer-config.xml** file using any text editor, and change the status of the `StartDBServer` property from `false` to `true`. 5. Navigate to the **** folder, open the **pg_hba.conf** file using any text editor, and remove the following entry to revoke the secondary server's access from the primary database: - **host all pmpuser /32 md5** 6. Now, start the PAM360 service. You have successfully removed the secondary server from your HA architecture. ## 2. Removing the Read-Only Server Uninstall the PAM360 application from the configured RO server, and then follow the steps below on the primary server: 1. Stop the PAM360 service. 2. Open the command prompt, navigate to the **/bin** folder, and execute the following command to delete an existing Read-Only server: - **Windows** ```bat \bin\DeleteROServerIP.bat ``` - **Linux** ```bash /bin/DeleteROServerIP.sh ``` 3. Execute the following command to delete the replication slot configured for the Read-Only server: - **Windows** ```bat \bin\DeleteSlot.bat ``` - **Linux** ```bash /bin/DeleteSlot.sh ``` 4. Navigate to the **** folder, open the **pg_hba.conf** file with any text editor, and remove the following entry to revoke the Read-Only server's access to the primary database: - **host replication /32 md5** 5. Now, start the PAM360 service.