Upgrading the H2 database from 2.x to 2.y version - 8.0

Talend Migration and Upgrade Guide

Version
8.0
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Activity Monitoring Console
Talend Administration Center
Talend Artifact Repository
Talend CommandLine
Talend Data Preparation
Talend Data Stewardship
Talend ESB
Talend Identity and Access Management
Talend JobServer
Talend LogServer
Talend MDM Server
Talend MDM Web UI
Talend Runtime
Talend SAP RFC Server
Talend Studio
Content
Installation and Upgrade
Last publication date
2024-04-15

The H2 database driver is upgraded to version 2.2.224, following CVE issues. The database built by the old driver version is not compatible with version 2.2.224. To upgrade the database, you need to backup the database with the old H2 driver and restore this backup on the new driver.

Procedure

  1. Backup Talend Administration Center with H2 database: copy
    /<tomcat_path>/webapps/org.talend.administrator
    into a backup directory: <backup_directory_path>.
  2. Unzip the database driver JARs:
    • The old one (h2.2.x.jar, for example).
    • The new one (h2-2.2.224.jar).
  3. Open a terminal into
    <backup_directory_path>/org.talend.administrator/WEB-INF/lib 
    Enter the following command with the old version of the driver: java -jar h2-2.x.jar.
    This automatically launches the H2 browser console at http://localhost:8082/.
  4. Provide the old database file location:
    jdbc:h2:/path/to/backup_dir/org.talend.administrator/WEB-INF/database/talend_administrator;AUTO_SERVER=TRUE;lock_timeout=15000;DEFAULT_LOCK_TIMEOUT=15000;
    LOCK_MODE=0;MODE=LEGACY
    and the credentials to log into the old database.
  5. Enter the following command in the console SCRIPT TO '<backup_file_path>/backup.sql';
    Click Run.
    This will export the content of the old database to a SQL file with the provided name and at the given location.
  6. Shut down the previous H2 server.
  7. Open <tomcat_path>/webapps/ and remove all files in /<tomcat_path>/webapps/org.talend.administrator/database.
  8. To launch the H2 browser console at http://localhost:8082/., open a terminal inside /<tomcat_path>/webapps/org.talend.administrator/WEB-INF/lib and enter the following command:
    java -cp h2*.jar org.h2.tools.Server -ifNotExists.
  9. Provide the path to the database location that you entered before to create the backup.sql file:
    jdbc:h2:/<tomcat_path>//webapps/org.talend.administrator/WEB-INF/database/talend_administrator;AUTO_SERVER=TRUE;lock_timeout=15000;DEFAULT_LOCK_TIMEOUT=15000;
    LOCK_MODE=0;MODE=LEGACY
  10. Log into the new database and use the following command to import the data from the backup file.
    RUNSCRIPT FROM '<backup-file-path>/backup.sql';
  11. Start Talend Administration Center console.

Results

Talend Administration Center now uses the new H2 database which works with the new 2.2.224 driver.