H2 Database Migration

Why is h2db migration required?

InformixHQ 2.1.0 has upgraded its H2 Database version due to the following security vulnerabilities present in the older versions of H2 Database:
  • CVE-2021-42392
  • CVE-2021-23463
  • CVE-2022-23221

Between H2 Database version 1.4.192 and the latest H2 Database version 2.1.214, there have been considerable changes and direct upgrade of H2 Database is not possible. For existing users, H2 Database (InformixHQ 1.6.3 or lower) is created with version 1.4.192, hence data needs to be migrated to 2.1.214 manually. Two options for this manual migration are explained in this tutorial.

For new users who are using InformixHQ for the first time (version 2.1.0 or higher), there is no impact, and no upgrade is needed as InformixHQ will create new H2 database with the latest version.

What is the impact if you have not migrated to the new version of H2 Database?

If users using InformixHQ 1.6.3 or lower try to move to InformixHQ 2.1.0 or above, they will not be able to start InformixHQ until the data is migrated to the newer version of H2 Database. If users try to run InformixHQ 2.1.0 or above without this migration done, they will get the following error in the InformixHQ log file:

"org.h2.mvstore.MVStoreException: The write format 1 is smaller than the supported format 2 [2.1.214/5]"

Users will also get a console message providing steps of migration along with a documentation link for reference.

For new users who are using InformixHQ for the first time (version 2.1.0 or higher), there is no impact and no upgrade is needed as InformixHQ will create new H2db with the latest version.

Note:
  1. If existing users start InformixHQ (2.1.0 or higher) using java -jar command as shown below, InformixHQ will not be started and the information given below is shown to the users on console.

    java -jar informixhq-server.jar informixhq-server.properties
    Unable to start InformixHQ server as H2db version is older and needs upgrade. Please run below command to upgrade H2db to newer version.
    
    Please note: 
    
    1) Path of the old InformixHQ server jar (version 1.6.3 or lower) should be known, and should be supplied where ${OLDHQDIR} is referenced in
     the command below.
    
    2) If ${OLDHQDIR} jar path is not available, then this upgrade needs to be completed using a few manual steps. For details of this migration,
     refer Manual steps.
    
    3) Optional second parameter -> Path of the properties file. If any H2db configuration properties are set previously, then this should be 
    supplied where ${PROPERTIES_DIR} is referenced in the command below.
    
    4) Current directory should contain old h2db.mv.db file.
    
    5) ${NEWHQDIR} referenced below is the current InformixHQ (2.1.0 or higher) jar path. Default informixhq-server.jar path is {INFORMIXDIR}/hq/
    
    Migration command:
    
    1) java -cp ${NEWHQDIR}/informixhq-server.jar com.informix.hq.server.h2.upgrade.H2Upgrade ${OLDHQDIR}/informixhq-server.jar
    OR
    2) java -cp ${NEWHQDIR}/informixhq-server.jar com.informix.hq.server.h2.upgrade.H2Upgrade ${OLDHQDIR}/informixhq-server.jar
     ${PROPERTIES_DIR}/informixhq-server.properties
    
  2. If users start InformixHQ using startup scripts, InformixHQ will not be started and there will be no information on the console. Users need to check the hq server logs for details.