Database Switch

MySQL database

PostgreSQL database

MSSQL database

Oracle database

Important Note for Migration from H2 database

Please make sure to use H2 database driver v1.4.196 for correct connection to the existing database to pull data from.

The database h2-1.4.196.jar driver is located in activitytimeline/webapps/ROOT/WEB-INF/lib folder.

MySQL database


  • CaseActivityTimeline is configured to use H2 database by default. A customer would like to migrate it to their MySQL database. 
  • Q: Could you send directions for doing this? 
  • A: Here is the documentation regarding switching a database engine: 
    • ActivityTimeline is pre-configured to use built-in H2 database.
    1. Open activitytimeline/webapps/ROOT/WEB-INF/classes/configuration.properties file and edit it if you'd like to change a database engine to MySQL. 
    2. Make sure MySQL database was installed on your server before and has "timeline" database created. 
    3. It is also required that “timeline” database uses UTF8 character set by default.
    4. Replace everything in configuration.properties file with the following data to connect to MySQL database:
      1. MySQL Database connection URL

        dataSource.url=jdbc:mysql://<MySQL_HOST>:<MySQL_PORT>/<MySQL_DATABASE_NAME_FOR_ACTIVITYTIMELINE>
        dataSource.url=jdbc:mysql://127.0.0.1:3306/timeline?autoReconnect=true&autoreconnect=true&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
      2. MySQL Database username

        dataSource.username=at_user
      3. MySQL Database password

        dataSource.password=at_password
      4. Other properties

        dataSource.pooled=true
        dataSource.driverClassName=com.mysql.jdbc.Driver
        dataSource.dbCreate=update
        # MySql 5.5, 5.6, 5.7:
        dataSource.dialect=com.timeline.hibernate.ActivityTimelineMySQLDialect
        # MySql 8.0+:
        # dataSource.dialect=com.timeline.hibernate.ActivityTimelineMySQL8Dialect
    5. Replace at_user and at_password with actual username/password combination of your MySQL database user.
    6. Restart ActivityTimeline afterwards.


       If you would like to migrate existing data from H2 database to MySQL, then you would need to use an external tools to migrate the database data like SQuirreL SQL with SQuirreL DB Copy Plugin (first you need to install SQuirreL SQL and on top of that the SQuirreL DB Copy Plugin). Also, you may need to start ActivityTimeline on an empty external database (schema) first for ActivityTimeline to create all required tables and relations.

      H2 database files are located at activitytimeline/bin/atdb folder.


      IMPORTANT: Upgrade to MySQL v8.0+
      MySQL 8.0 and above have "lead", "rank" and few other words reserved and cannot be used as column names.
      As a result it is required to perform a specific procedure to upgrade MySQL to v8.0.
      1. Open <AT_FOLDER>/activitytimeline/webapps/ROOT/WEB-INF/classes/configuration.properties file for editing and add the following line:

        dataSource.dialect=com.timeline.hibernate.ActivityTimelineMySQL8Dialect
      2. Save it.
      3. Alter database structure (see below)
      4. Restart ActivityTimeline.


      You should alter the MySQL 5.6/5.7 ActivityTimeline database schema before the upgrade to MySQL 8.0:
      1. Column "rank" of "issue" table should be renamed to "issue_rank"
      2. Table "level" should be renamed to "knowledge_level"
      3. Table "priority" should be renamed to "rlx_at_priority"
      4. Rename the following columns of "project" table:
        1. "priority" to "prj_priority"
        2. "active" to "prj_active"
        3. "lead" to "prj_lead"
      5. Rename the following columns of "worklog_record" table:
        1. "date" to "worklog_date"
        2. "comment" to "worklog_comment"

   

PostgreSQL database


  • CaseActivityTimeline is configured to use H2 database by default. A customer would like to migrate it to their PostgreSQL database. 
  • Q: Could you send directions for doing this?


A: Here is the documentation regarding switching a database engine to PostgreSQL
1. ActivityTimeline is pre-configured to use built-in H2 database.
2. Please open activitytimeline/webapps/ROOT/WEB-INF/classes/configuration.properties file 
for editing. 
3. Please make sure PostgreSQL database is installed on your server before and has "timeline" schema created. 
4. It is also required that “timeline” database schema uses UTF8 character set by default.
Replace everything in configuration.properties file with the following data to connect to PostgreSQL database:
 

#  PostgreSQL Database connection URL
dataSource.url=jdbc:postgresql://localhost:5432/timeline?autoReconnect=true&autoreconnect=true&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8

# PostgreSQL Database username
dataSource.username=at_user

# PostgreSQL Database password
dataSource.password=at_password

#  Other properties
dataSource.pooled=true
dataSource.driverClassName=org.postgresql.Driver
dataSource.dbCreate=update
5. Please replace at_user and at_password with actual username/password combination of your PostgreSQL database.
6. Restart ActivityTimeline afterwards

.

 If you would like to migrate existing data from H2 database to PostgreSQL, then you would need to use an external tools to migrate the database data like SQuirreL SQL with SQuirreL DB Copy Plugin (first you need to install SQuirreL SQL and on top of that the SQuirreL DB Copy Plugin). Also, you may need to start ActivityTimeline on an empty external database (schema) first for ActivityTimeline to create all required tables and relations.
 H2 database files are located at activitytimeline/bin/atdb folder.

That should be it!
.

  

MS SQL Server database

  • CaseActivityTimeline is configured to use H2 database by default. A customer would like to migrate it to their MSSQL database. 
  • Q: Could you send directions for doing this?


A: Here is the documentation regarding switching a database engine to MSSQL
1. ActivityTimeline is pre-configured to use built-in H2 database.
2. Please open activitytimeline/webapps/ROOT/WEB-INF/classes/configuration.properties file 
for editing. 
3. Please make sure MSSQL database is installed on your server before and has "timeline" database created. 
4. Define character set for “timeline” database. It is recommended to use the same collation as for JIRA. Usually: 'SQL_Latin1_General_CP437_CI_AI' or 'Latin1_General_CI_AI' case-insensitive. 
Replace everything in configuration.properties file with the following data to connect to MSSQL database:
 
#  MS SQL Server Database connection URL
# Structure: dataSource.url=jdbc:jtds:sqlserver://;serverName=<MSSQL_HOST>;portNumber=<MSSQL_PORT>;databaseName=<MSSQL_DATABASE_NAME_FOR_ACTIVITYTIMELINE>;integratedsecurity=false;socketTimeout=60000
dataSource.url=jdbc:sqlserver://;serverName=localhost;portNumber=1433;databaseName=timeline;integratedsecurity=false;socketTimeout=60000

# MSSQL Database username
dataSource.username=at_user

# MSSQL Database password
dataSource.password=at_password

#  Other properties
dataSource.pooled=true
dataSource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
dataSource.dialect=com.timeline.hibernate.ActivityTimelineMSSqlServerDialect
dataSource.dbCreate=update


# -------------------------------------------------

# Or Alternative jTDS MSSQL driver

# Alternative MSSQL Database connection URL - jTDS driver
# Structure: dataSource.url=jdbc:jtds:sqlserver://<MSSQL_HOST>:<MSSQL_PORT>;databaseName=<MSSQL_DATABASE_NAME_FOR_ACTIVITYTIMELINE>
dataSource.url=jdbc:jtds:sqlserver://localhost:1433;databaseName=timeline

# MSSQL Database username
dataSource.username=at_user

# MSSQL Database password
dataSource.password=at_password

#  Other properties
dataSource.pooled=true
dataSource.driverClassName=net.sourceforge.jtds.jdbc.Driver
dataSource.dialect=org.hibernate.dialect.SQLServerDialect
dataSource.dbCreate=update
5. Please replace at_user and at_password with actual username/password combination of your MSSQL database.
6. Restart ActivityTimeline afterwards


 If you would like to migrate existing data from H2 database to MSSQL, then you would need to use an external tools to migrate the database data like SQuirreL SQL with SQuirreL DB Copy Plugin (first you need to install SQuirreL SQL and on top of that the SQuirreL DB Copy Plugin). Also, you may need to start ActivityTimeline on an empty external database (schema) first for ActivityTimeline to create all required tables and relations.
 H2 database files are located at activitytimeline/bin/atdb folder.

Also, please make sure all migrated table names are in lowercase letters e.g. "person", not "PERSON". All table names in UPPERCASE letters should be renamed to lowercase letters.

  

Oracle database

  • CaseActivityTimeline is configured to use H2 database by default. A customer would like to migrate it to their Oracle database engine. 
  • Q: Could you send directions for doing this?


A: Here is the documentation regarding switching a database engine to Oracle DB v12.1.0 or newer: 
1. ActivityTimeline is pre-configured to use built-in H2 database.
2. Please open activitytimeline/webapps/ROOT/WEB-INF/classes/configuration.properties file 
for editing. 
3. Please make sure Oracle database engine is installed on your server before and has "timeline" database created. 
4. Define character set for “timeline” database. It is recommended to use the same character set as for JIRA. Usually: 'UTF8' or 'AL32UTF8'. 
5. Enable "Extended Data Types" in Oracle DB for VARCHAR2 type to support up to 32767 bytes: https://docs.oracle.com/en/database/oracle/oracle-database/18/spuss/enabling-the-new-extended-data-type-capability.html
Replace everything in configuration.properties file with the following data to connect to Oracle database:
 
 
# Oracle Database connection URL
# Structure: dataSource.url=jdbc:oracle:thin:@//<ORACLE_DB_HOST>:<ORACLE_DB_PORT>/<SERVICE_NAME_FOR_ACTIVITYTIMELINE>
#dataSource.url=jdbc:oracle:thin:@//localhost:1521/timeline

# Oracle Database username
#dataSource.username=at_user

# Oracle Database password
#dataSource.password=at_password

# Other properties
#dataSource.pooled=true
#dataSource.driverClassName=oracle.jdbc.driver.OracleDriver
#dataSource.dialect=com.timeline.hibernate.ActivityTimelineOracleDialect
#dataSource.dbCreate=update
#dataSource.properties.validationQuery=SELECT 1 FROM DUAL

5. Please replace at_user and at_password with actual username/password combination of your Oracle database.
6. Restart ActivityTimeline afterwards


 If you would like to migrate existing data from H2 database to Oracle DB, then you would need to use an external tools to migrate the database data like Oracle SQL Developer, SQuirreL SQL with SQuirreL DB Copy Plugin (first you need to install SQuirreL SQL and on top of that the SQuirreL DB Copy Plugin). Also, you may need to start ActivityTimeline on an empty external database (schema) first for ActivityTimeline to create all required tables and relations.

It is required to enable "Extended Data Types" in Oracle DB for VARCHAR2 type to support up to 32767 bytes: https://docs.oracle.com/en/database/oracle/oracle-database/18/spuss/enabling-the-new-extended-data-type-capability.html

Important Note for Oracle DB v12.2.0 and above switch: it is required to rename several entities before the migration for Oracle DB correct work:

  • "level" table should be renamed to "knowledge_level",
  • "password" column of "person" table must be renamed to lowercase letters
  • "date" column of "worklog_record" table should be renamed to "worklog_date"
  • and "comment" column of "worklog_record" table should be renamed to "worklog_comment"


Important Note for Oracle DB v12.1.0 switch: it is required to rename several additional entities before the migration for Oracle DB correct work:

  • "level" table should be renamed to "knowledge_level",
  • "password" column of "person" table must be renamed to lowercase letters
  • "date" column of "worklog_record" table should be renamed to "worklog_date"
  • "comment" column of "worklog_record" table should be renamed to "worklog_comment"
  • "parent_issue_remaining_time_estimate" column of "issue" table should be renamed to "parent_remain_time_estimate"
  • "anticipated_start_date_field_name" column of "integration_config" table should be renamed to "start_date_field"
  • "anticipated_end_date_field_name" column of "integration_config" table should be renamed to "end_date_field"
  • "issue_part_assignee_field_name" column of "integration_config" table should be renamed to "issue_part_assignee_field"
  • "connect_access_token_created_date" column of "integration_config" table should be renamed to "connect_token_created_date"
  • "issue_id_for_getting_list_of_assignees" column of "integration_config" table should be renamed to "issue_id_for_users"


  • Additional setting should be added to configuration.properties file:
     dataSource.oracleLegacyMode=1


H2 database files are located at activitytimeline/bin/atdb folder.