SystemLink PostgreSQL Database Fails to Start After Changing Its Path

Updated Feb 23, 2023

Reported In

Software

  • SystemLink Server

Issue Details

I opened the NI SystemLink Server Configuration dialog, clicked on the PostgreSQLDatabase category on the left, then entered the new Database path where I wanted my PostgreSQL database to live.
PostgreSQLDatabase path

When I hit the Apply button, the SystemLink services all automatically restarted, but the PostgreSQLDatabase service now toggles between "Starting" and "Initializing" and back again, never going live.  Additionally, the TestMonitor service also never goes live.

Solution

This problem occurs because changing the PostgreSQL database path does NOT update the "Postgres.DatabaseStatus: ready" parameter in the PostgreSQL configuration file:
C:\ProgramData\National Instruments\Skyline\Config\PostgreSQLDatabase.json

This Database.Status parameter indicates whether a new PostgreSQL database instance should be created at the new path.  The "ready" parameter indicates that the database instance already exists and does not need to be added there.

PostgreSQLDatabase.json

To get the services started again, edit the PostgreSQLDatabase.json file by removing the "Postgres.DatabaseStatus: ready" line entirely, saving the file, then restarting the SystemLink services in the NI SystemLink Server Configuration dialog.

Additional Information

SystemLink services launch in a specific order, since they in many cases depend on each other.  As an example, the TestMonitor service requires that the PostgreSQLDatabase service be live before it can go try to start.  This is why two services were stopped by the missing PostgreSQL database.

By default SystemLink Server installs a PostgreSQL database instance in the following local folder:
C:\Program Files\National Instruments\Shared\Skyline\NoSqlDatabase\bin