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
-
Backup Talend Administration Center
with H2 database: copy
/<tomcat_path>/webapps/org.talend.administrator
into a backup directory: <backup_directory_path>.
-
Unzip the database driver JARs:
- The old one (h2.2.x.jar, for example).
- The new one (h2-2.2.224.jar).
-
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.
-
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.
-
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.
-
Shut down the previous H2 server.
-
Open <tomcat_path>/webapps/ and remove all files in
/<tomcat_path>/webapps/org.talend.administrator/database.
-
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.
-
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
-
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';
-
Start Talend Administration Center
console.
Results
Talend Administration Center now uses the new H2 database which works with the new 2.2.224 driver.