Running Monitor ERP and PostgreSQL on separate servers
This guide explains how to migrate a Monitor ERP database from SQL Anywhere to PostgreSQL when the application server and database server are hosted on separate computers. Install PostgreSQL on the database server, then run PostgreSQL Assistant on the Monitor server to connect to PostgreSQL and perform the migration.
Install PostgreSQL and connect to the database server
-
Download the latest version of PostgreSQL and install it manually on the database server. Installation files are available from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads.
-
During installation, select a Data Directory on a drive with sufficient free space. This directory will store the databases.
-
Save the password for the PostgreSQL database superuser (postgres) in a secure location. You will need it later.
-
After installation, Stack Builder may open. You can close it if you do not need any additional tools. You can start it again later if required.
-
PostgreSQL is now installed and running. To access it from the Monitor server, allow traffic through the PostgreSQL port in the database server’s firewall. The default port is 5432.
-
PostgreSQL also uses the host-based authentication file pg_hba.conf to control connections from other computers. Open pg_hba.conf in the PostgreSQL Data Directory. To allow a server with the IP address 192.168.10.25 to connect, add the following line at the end of the file:
host all all 192.168.10.25/32 scram-sha-256
Replace 192.168.10.25 with the IP address of the Monitor server.
Use /32 to allow only one specific IP address.For more information, see the official PostgreSQL documentation: https://www.postgresql.org/docs/current/auth-pg-hba-conf.html.
-
On the Monitor server, start the PostgreSQL Assistant (Monitor.PostgreSQL.Assistant.exe) from the Monitor server folder.
-
In PostgreSQL Assistant, select Setup PostgreSQL, and then select Connect to existing. Enter the address and credentials for the PostgreSQL server, and then select Connect.
-
Once the connection has been established, prepare the companies and start the migration in PostgreSQL Assistant. For additional guidance, click on Instructions in the assistant.
Configure backups on a separate database server
If backups will run on a separate or external database server, install and configure Monitor Postgres Backup on that server:
-
On the Monitor server, use Installation Manager to install Monitor Postgres Backup.
-
Copy the Monitor Postgres Backup folder from the Monitor ERP System AB folder on the Monitor server to the database server.
-
On the database server, run MonitorPostgresBackupInstallation.PIL.exe.
-
Configure the login credentials and backup schedule. After installation, the service uses the settings in appsettings.json.
-
Updates to Monitor Postgres Backup must be downloaded manually through Installation Manager. After downloading an update, copy the updated Monitor Postgres Backup folder from the Monitor server to the database server.
-
The appsettings.json configuration file is normally retained unless its structure changes in the new version. Before copying an updated version of Monitor Postgres Backup, make a backup copy of appsettings.json. If the file is overwritten, use the copy to restore the backup configuration.
-
Check that backups run correctly from the database server. If Monitor Postgres Backup is no longer needed on the application server, you can then uninstall it from that server.