Skip to content

Database Configuration

This section describes how to configure the database.

Prerequisites

The database must be created prior to installing the solution. You will need the database information (host, port or URL) and credentials (service account) to configure it.

Important

The database should be configured to use Unicode (UTF-8) encoding as a default for all tables. The solution supports many languages and this ensures that they are properly supported.

Configuration

The solution uses JDBC to connect to the database which allows supporting multiple database vendors. This standardizes the configuration to a few parameters.

These parameters are defined in the file [Install folder]/server/conf/sfiler.conf:

properties
cfg.server.local.config.url=[database URL]
cfg.server.local.config.user=[database service account username]
cfg.server.local.config.password=[database service account password]
cfg.server.local.config.driver=[JDBC driver class name]

Dialect Hibernate

The cfg.server.local.config.hibernate.dialect parameter is optional. If you do not specify it, the solution will use the default dialect of Hibernate.

The detailed guides for each database vendor are listed below and will indicate the values to use for each parameter.

System Configuration

A quick note on system configuration: The solution has a CLI and a web console (called Configurator) to configure the system. These tools require database credentials to connect and make changes in the database. These credentials can be different from the service account that is used by the solution.

Recommendation

OKIOK recommends that each administrator use their own database credentials to make configuration changes instead of the service account that is used by the solution.

Schema management

The solution uses Liquibase to automatically manage the database schema. Liquibase tracks all changes to the schema and makes sure that the database is always in the desired state.

Initializing the database

The tool used to initialize the database is the sfiler-config-cli, which is automatically installed with the server. There is a script called sfiler-config-cli (.bat for Windows and .sh for Linux) located in the [Install folder]/server folder.

Note

Before issuing the command to initialize the database, make sure you have installed the JDBC driver for your database in the [Install folder]/server/ext/lib directory.

You need to run the following command:

shell
sfiler-config-cli.[bat/sh] -l db_user_name -p db_password update-db-schema

The parameters db_user_name and db_password represents the credentials that will be used to connect to the database and perform the modifications. This will require alter, create, drop and other type of access so make sure the database user specified in the command has an admin role.

If you want to be prompted for the password instead of putting it on the command-line do not use the -p option, do not put any option for the password.

For more details on this command, please refer to the update-db-schema command documentation.