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.

 

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.

 

Through the web-based MFT Server Manager

 

  1. 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.

     

  2. In the Launching the MFT Server Manager, navigate to Settings > DATASTORE > Datastore and 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.

     

     

  3. 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.

    clip0249

     

    Note: You must click the CreateDB button before clicking the optional TEST Parameters button. If you click the Test Parameters button before creating the database, a message box will pop up with a 500 Internal Server, depicted in the leftmost image below.  A successful datastore test will display a popup message depicted in the rightmost image below.

     

     

  4. Click the Apply button to initiate the migration. You will then be asked to confirm if existing configuration data should be copied. Click Yes 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

 

  1. 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

     

  2. Stop the MFT Server service.

     

  3. 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 a MySQL database named jscapeconfig 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

     

  4. 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

     

  5. 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.