Sample Script Execution

Before you use the cloudconfig script, you must copy the jdbc jar file to the following directory: MFT Install/cloud/dbconfig/lib

This script can be executed for UNIX or Windows, regardless of where TIBCO MFT Internet Server is installed. So even if TIBCO MFT Internet Server is installed on Linux in the DMZ, you can update the database in Windows, as long as Windows has connectivity to the database. This script also creates a log file of all commands entered. The file created is called:

MFT-Install/cloud/dbsettings/db-install.YYYY.MM.DD.HH.MM.SS.log

To get help information on this script, enter the following command:

clouddbsetup.sh help

There are three formats of the clouddbconfig script:
  1. Create and manage database connections with an interactive menu.

    clouddbconfig

  2. Run a database update of an MFT database (with confirmations).

    clouddbconfig config name

  3. Run a database update of an MFT database in silent mode (with no confirmations).

    clouddbconfig config name silent

Note: When performing a database update, the database is updated to the level associated with the MFT installation where the dbcloudconfig files are located.

Two different files can be updated or created by this script:

  1. db-settings.xml. An entry is created in this file for each config entry created. This entry can be used to update the MFT database, either through the interactive script or the automated scripts (silent and with confirmations)
  2. An xml file generated by selecting "Generate Cloud Database XML file". This file is fed into the Docker Container through the COM_TIBCO_MFT_CE_DBCFG environment variable. This environment variable can be defined in one of two ways:
    1. Through environment variable when starting a Docker Container
    2. Through the spec:env parameter defined in the Kubernetes YAML file

TIBCO MFT Internet Server detects this environment variable at startup. TIBCO MFT Internet Server reads this file and substitutes the DB setup parameters defined in the web.xml with the parameters defined in this file.

Note: This file must be saved to the persistent storage accessed by the MFT container.
Note: If you want to use a PostgreSQL database, the CITEXT extension must be installed. To enable the CITEXT data type, you must install the PostgreSQL CITEXT extension and execute the following SQL command as a super admin for the PosgreSQL MFT database:

CREATE EXTENSION IF NOT EXISTS CITEXT;

See the information below to create a database server configuration entry:
clouddbconfig.bat

Main Menu
=========
1. Add Database Server settings
2. Manage Database Server settings
3. Save your changes
4. Exit

Please enter the number corresponding to your selection: 1

1. Add database server configuration entry
==========================================

Enter a name for the database configuration settings entry: mftqadb

Select database server type:
Enter 1 for MSSQL
Enter 2 for MySQL Enterprise Server or Community Server
Enter 3 for Oracle
Enter 4 for DB2
Enter 5 for PostgreSQL
: 2

MySQL selected as database server type.

Enter the DNS name or IP Address of the database server...[localhost]:mysql.qasvr
Enter the database port number.................................[3306]:
Enter the database name........................................[cfcc]:mftqadb
Enter the database UserID......................................[cfcc]:
Enter the database Password....................................[cfcc]:
Please confirm the password:

Use database URL: [jdbc:mysql://mysql.qasvr:3306/mftqadb?characterEncoding=UTF8&useSSL=false]? y/n [y] :

Verifying database connection using the following URL:
jdbc:mysql://mysql.qasvr:3306/mftqadb?characterEncoding=UTF8&useSSL=false

Connected successfully to mftqadb

mftqadb added successfully.

Press enter for menu options

Main Menu
=========
1. Add Database Server settings
2. Manage Database Server settings
3. Save your changes
4. Exit

Please enter the number corresponding to your selection: 3

Changes saved successfully.
See the information below to create a cloud database XML file:
clouddbconfig.bat

Main Menu
=========
1. Add Database Server settings
2. Manage Database Server settings
3. Save your changes
4. Exit
Please enter the number corresponding to your selection: [log: 	2]
Manage Servers
==============
1. mft830  [ mysql, jdbc:mysql://localhost:3306/mft830?characterEncoding=UTF8&useSSL=false&serverTimezone=UTC ]
Please enter the number of the server to view details and manage or 'X' to return to main menu: 1
Server Details [postgre]
==============
Name:                 mft830
DB Type:              mysql
DB User Id:           root
DB Password:          *****
DB Connection URL:    jdbc:mysql://localhost:3306/mft830?characterEncoding=UTF8&useSSL=false&serverTimezone=UTC
DB Driver ClassName:  com.mysql.jdbc.Driver
Press enter for menu options
Server Detail Menu [postgre]
==================
1. View Entry
2. Update Entry
3. Copy Entry
4. Delete Entry
5. Test Database Connection
6. Generate Cloud Database XML file
7. Display Cloud Database Environment variables
8. Update the Database
9. Save your changes
10. Back to Main Menu
11. Exit
Please enter the number corresponding to your selection: [log: 	6]
Enter the name of the file to write the cloud entry to: [log: 	c:\temp\mftqadb.xml]
c:\temp\mftqadb.xml created successfully.
Here are the contents of the mftqadb.xml file created:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<para>
    <!--the DB driver name-->
    <DBDriver>com.mysql.jdbc.Driver</DBDriver>
    <!--DB URL connection string-->
    <DBConn>jdbc:mysql://mftdb2:3306/cfcctb?characterEncoding=UTF8&amp;useSSL=false</DBConn>
    <!--DB user-->
    <DBUser>cfcc</DBUser>
    <!--DB password, encrypted with MFT install routine. For test, can use clear text password by using clear:pwd-->
    <DBPass>JNKryaVHBCE1QnhCNuHfOaKo/+E=</DBPass>
    <!--DB Type, valid values: mysql, mssql, oracle, or postgresql-->
    <!--If a valid value is specified, MFT will try to create tables for an empty DB during start up time. Otherwise, MFT will not try to create tables during start up time.-->
    <DBType>mysql</DBType>
</para>