Migrating inbuilt Postgres(PG) SQL to a common PGSQL database (DB)
Last updated on:
In this page
Overview
This section explains how to migrate the bundled DB to a common DB, configure access, and manage changes in the DB IP.
Steps to migrate bundled DB
- Stop Log360
NOTE Stopping Log360 is not required to create the service. However, the bundled DB must be stopped before you can start the service.
- Run Command Prompt as Admin.
- Place the migration script migrateBundledDBAsExternal.bat inside: <LOG360_HOME> \bin
- Navigate to the bin directory and execute the migration command: migrateBundledDBAsExternal.bat <IP/HOST_NAME>
- Add the following entries in the common DB host’s pgsql\data\pg_hba.conf file to allow client connections:
Figure 1: Accessing the services application - Start the PostgreSQL service: ManageEngineLog360Postgres
NOTE Allow inbound/outbound rules in the postgres machine for client machines to access the DB. Ensure Log360 server is started at least once before migration to initialize the database.
Handling DB IP changes
If the common DB IP changes, you must unregister and re-register the PostgreSQL service with the new IP. Two methods are available:
Manual method
- Stop the running service.
- Run the following command as Administrator to unregister the service: .\pg_ctl unregister -N "ManageEngineLog360Postgres"
- Update the new IP in the database_params.conf
- Re-register the service with the new IP: pg_ctl register -N "ManageEngineLog360Postgres" -D "path to pgsql\data" -o "-p 33335 -h ip/hostname"
- Update the new IP in the database_params.conf file of both server and processors.
- Start the service.
Using the batch file
You can use reregisterDB.bat file to automatically execute the unregister and re-register commands.
NOTE The batch file is located in <Log360_HOME>\bin
Syntax:
- reregisterDB.bat <new_ip>
- <new_ip> is mandatory, specifies the new IP address of the common database. The script re-registers the default service ManageEngineLog360Postgres.
- reregisterDB.bat <new_ip> <service_name>
- <service_name> refers to the PostgreSQL service name. The script re-registers the specified service.
Read also
This page explained how to migrate the inbuilt PostgreSQL to a common PostgreSQL database in Log360.