Table of Contents

By default, an HSQL in-memory SQL database is delivered with the Graphlytic installation. HSQL is embedded in Graphlytic and is started automatically when Graphlytic is started.

As of version 5.2.0, external PostgreSQL is also supported.

1. How to set up a PostgreSQL connection

Graphlytic needs to be run with one of:

  • GRAPHLYTIC_DATABASE_DIALECT=postgres environment variable. Environment variables always take precedence over graphlytic.conf file.

  • graphlytic.database.dialect=postgres entry in graphlytic.conf file

Graphlytic then tries to connect to PostgreSQL with the default values. Default values can be modified with environment variables or graphlytic.conf file:

Parameter name
(environment variable)

Parameter name
(graphlytic.conf)

Description

Supported dialects

Default value for dialect postgres

GRAPHLYTIC_DATABASE_DIALECT

graphlytic.database.dialect

Supported values are:
hsql, postgres

hsql postgres

postgres

GRAPHLYTIC_DATABASE_SCHEMA

graphlytic.database.schema

Database schema where Graphlytic metadata will be stored. Graphlytic automatically converts the schema name to uppercase for HSQL and to lowercase for PostgreSQL.

hsql postgres

graphlytic

GRAPHLYTIC_DATABASE_NAME

graphlytic.database.name

Database name.

postgres

graphlytic

GRAPHLYTIC_DATABASE_USERNAME

graphlytic.database.username

Username needed for database authentication.

postgres

postgres

GRAPHLYTIC_DATABASE_PASSWORD

graphlytic.database.password

A password for the database authentication.

postgres

postgres

GRAPHLYTIC_DATABASE_HOST

graphlytic.database.host

Database domain name with path (if applicable).

postgres

localhost

GRAPHLYTIC_DATABASE_PORT

graphlytic.database.port

Database port.

postgres

5432

2. How to migrate from HSQL DB to PostgreSQL

Graphlytic version 5.2 or later must be used. If you have an older version, please first upgrade to the latest version of Graphlytic.

To migrate an existing HSQL DB to PostgreSQL, please follow these steps:

  1. Run Graphlytic with the “postgres” dialect (see chapter above).

  2. Open the API page in Graphlytic and find the POST /migrate service in the “Other” group.

  3. Click on the “Try it out” button.

  4. Enter the full path to the db_hsql folder that should be migrated to PostgreSQL.

  5. Click on “Execute”. In case of a successful migration, the return code is 200.

  6. It is recommended to restart graphlytic after migration.

Migration is done using UPSERT commands. This means that all records from the HSQL DB are added to the existing records in PostgreSQL. If an ID conflict occurs, an update of the existing record is performed.