Database Migration
Using this option you can change the built-in database server (PostgreSQL) of Log360 to MS SQL Server or another instance of a PostgreSQL Server.
Important points to remember
- Supported database migrations:
- PostgreSQL Server to MS SQL Server or another instance of PostgreSQL Server.
- MS SQL Server to PostgreSQL Server or another instance of MS SQL Server.
- Supported database versions:
- PostgreSQL: 10 to 14
- MS SQL: 2008 and above
- Take a backup of the database before you proceed.
- We recommend applying the Windows service packs and cumulative updates suggested by Microsoft during your migration to MS SQL Server.
Prerequisites for MSSQL migration
Prerequisites for PostgreSQL migration
- Open the remote machine where the product is installed & navigate to Product Home\ pgsql\ data\ pg_hba.conf
- Open pg_hba.conf file and add an entry of the host IP address and its subnet mask as 0.0.0.0/0 (Refer Pic).
- Navigate to Product Home\ pgsql\ data \ postgresql.conf
- Open postgresql.conf and change the Listen_addresses as '*' & remove the # in the start of the line. (Refer Pic)
Database backup for External PostgreSQL
- In the machine where PostgreSQL is installed, go to <postgresql_installdir>/data and open the posgresql.conf file. Search for wal_level entry. Uncomment the entry and change its value to archive.
- Copy all the files in <postgresql_installdir>/lib and <postgresql_installdir>/bin folders and paste them in <product_home>/pgsql/lib and <product_home>/pgsql/bin folders respectively. Here, <product_home> refers to the home directory of Log360 or the integrated products for which you're configuring the auto backup scheduler.
- Restart the external PostgreSQL server.
Repeat the steps 1 to 3 from above whenever you update the PostgreSQL server.
Steps for Migration
Note: Take a Backup/Snapshot of Log360 before proceeding with the steps (Important)
- Open the Command Prompt and navigate to <Log360 home\bin> (Here, Log360 home is the location where Log360 is installed).
- Stop Log360 by running shutdown.bat.
- Run the ChangeDB.bat.
- From the Server Type menu, select the database server you plan to switch to.
- If you select PostgreSQL Server, then:
- In the Host Name and Port field, enter the host name or IP address and the port number of the PostgreSQL database server.
- Enter the username and password of a user with the necessary permissions to create a new database.
- If you select MS SQL Server, then:
- Move the bcp.exe and bcp.rll files into the bin folder manually.
- In the Host Name and Port field, enter the host name or IP address and the port number of the MS SQL database server.
- In the Select Server Instance field, select the SQL Server instance you want to use.
- For Authentication, you can use either Windows credentials or a SQL Server user account.
- If you want to use a SQL Server user account, then select SQL Authentication and enter the Username and Password.
- If you want to use Windows authentication, select Windows Authentication, and enter the username and password of a Windows domain user account.
Note: The user account used must have permission to create a database in the selected MS SQL Server.
- Check the box next to Migrate Existing Data to copy the data from your old database to the new database.
IMPORTANT: Leave this box unchecked only if you are changing the database of a fresh installation of Log360.
- If the MS SQL server you wish to migrate to has Force encryption enabled, check the box next to SSL connection.
- Click Test Connection and wait for the connection to be established.
- Once Test Connection has been established successfully, click Configure DB to initiate migration.