Migrating existing data to a centralized global datastore
If you already have an existing MFT Server installation and you want to migrate that installation's server configuration data from the built-in H2 database to a centralized global datastore (typically an external RDBMS), follow the instructions below.
Through the web-based MFT Server Manager
-
Create a database in the external relational database that will hold the global datastore and create a user account that has the correct permissions for the said database.
-
In the Launching the MFT Server Manager, enter the following information:
-
JDBC URL - the JDBC URL of your external relational database. For example, for a MySQL database named jscapeconfig hosted on a machine with IP address 192.168.100.105, the jdbc URL would be
jdbc:mysql://192.168.100.105/jscapeconfig
. The JDBC URL varies from one RDBMS to another, so please check your RDBMS documentation for more information. -
Username - the username of the user account you created in step 1.
-
Password - the username's corresponding password
-
-
Click the
Create DB
button to create tables in the empty database. If all goes well, a message box should appear indicating that the procedure completed successfully. -
Click the
Apply
button to initiate the migration. You will then be asked to confirm if existing configuration data should be copied. ClickYes
to confirm.Note: Please read the message on the dialog box very carefully when using this tool. Be sure you fully understand what each option does.
Yes
- Click this button if you wish to overwrite the configuration data in [target database] with configuration data found in [original database]. This is the option you would choose if you're migrating configuration data from the H2 database to an external database.No
- Click this button if you simply wish to use the configuration data in [target database] and leave all configuration data in [original database] intact.The
Apply
button will be temporarily disabled while the migration is carried out.Once the
Apply
button is re-enabled, the migration of server configuration data from the embedded H2 database to the external RDBMS should have completed.
Through the command line
-
Create a database in the external relational database that will hold the global datastore and create a user account that has the correct permissions for the said database
-
Stop the MFT Server service.
-
Launch a command line/terminal and navigate into the MFT Server installation directory. Copy the existing H2 global datastore database to your external relational database by entering the
js-database-configuration -copy
command line utility. In the example below, we're copying to aMySQL
database namedjscapeconfig
hosted on a machine with IP address 192.168.100.105. Replace the parameters below accordingly.js-database-configuration -copy -destination-url jdbc:mysql://192.168.100.105/jscapeconfig -destination-user databaseuser1 -destination-password secret
-
Configure MFT Server to use your external database. Again, in the example shown below, we're configuring a
MySQL
database (hence the MySQL jdbc url). Replace the parameters below accordingly.js-database-configuration -configure -url jdbc:mysql://192.168.100.105/jscapeconfig -user databaseuser1 -password secret
-
Start MFT Server.
When you go to Settings > DATASTORE > Datastore > JDBC URL
, you'll notice that it's already using the JDBC URL of whatever external database you've configured it for instead of the built-in H2 database.