js-database-configuration

The js-database-configuration command may be used to configure the database used for storing configuration settings in MFT Server.

 

Usage: js-database-configuration [-file <file>] configuration file

-configure | -test | -init | -update | -clear | -delete | -copy | -schema

 

Options:

 

[-url <URL>] database JDBC URL

[-user <username>] database username

[-password <password>] database password

[-pool <size>] connection pool size

[-ttl <seconds>] connection TTL seconds

[-sync-period <seconds>] synchronization period in seconds

[-destination-url <URL>] destination database JDBC URL

[-destination-user <username>] destination database username

[-destination-password <password>] destination database password

[-previous-version <version>] previous data version for updating

 

-configure - This option will create a configuration (database) file to store all the MFT Server configuration information.

If you enter this command: js-database-configuration -configure, the system will create a configuration file named database.properties in the installation-dir/etc folder using the default embedded H2 database. To change the location of the configuration file, you can use the -file option. For example: js-database-configuration -file /mydir/database.properties -configure.

 

Warning: The embedded H2 database that ships with MFT Server is not intended for production environments and is for evaluation purposes only. For production environments or evaluation environments with heavy usage and/or high availability requirements, it is recommended that an ANSI compliant relational database such as MySQL, MSSQL, Oracle, or PostgreSQL be used.

 

To configure an external datastore like MySQL, use the -configure option and enter the URL, username, and password as required.

 

js-database-configuration -configure -url <jdbc-url> -user <username> -password <password>

 

For example: js-database-configuration -configure -url jdbc:mysql://192.168.100.105/jscapeconfig -user databaseuser1 -password secret

-test - This option will test the connection to the database. The command to execute is js-database-configuration -test

 

-init - This option will initialize the database with all the required tables created. This option must be run after a new database is configured, no matter what database option is used (i.e. H2 or ANSI compliant relational database). The command to execute is js-database-configuration -init.

 

-update - This option will update the tables from the previous version if there are any changes to the table structure. For example, assume js-database-configuration -update -previous-version 2024.3.1.18 is executed. If there are changes to three tables from version 2024.3.1.18 to the latest versions, the three tables will be updated upon executing the command.

 

-clear - This option will purge all records and tables. The command to execute is js-database-configuration -clear.

 

-delete - This option will drop all tables. The command to execute is js-database-configuration -delete.

 

-copy - This option will copy the database configuration from one database to another. The command to execute is: js-database-configuration -copy -destination-url <jdbc-url> -destination-user <username> -destination-password <password>.

For example, to switch from the H2 database to mySQL, and migrate the existing data, use the command below. Replace the url, user, and password accordingly.

 

js-database-configuration -copy -destination-url jdbc:mysql://192.168.100.102/jscapeconfig -destination-user databaseuser1 -destination-password secret.

 

See also: Migrating existing data to a centralized global datastore

-schema - This option will print the schema for all tables. The command to execute is js-database-configuration -schema.