Smile CDR v2022.08.PRE
On this page:

35.12smileutil: Upgrade H2 Database File

 

Smile CDR versions below 2022.02.R01 used the H2 database version 1.4.x. As of Smile CDR 2022.02.R01, Smile CDR uses H2 version 2.0.x.

As of H2 2.0.x, a new binary database format has been introduced. This new format is incompatible with the previous format, and the database files must therefore be migrated.

Note that this upgrade is only needed for users of the H2 Database. All other database platforms have other migration strategies. As a reminder, you should never use H2 database for any production scenario as data loss can occur at any time. Smile CDR supports H2 only for testing.

35.12.1Usage

 

The upgrade-h2-database-file command will upgrade the database in place. Please ensure that:

  • Smile CDR is not running when this command is used
  • You have backed up your entire database directory before running this command

Once the migration has completed, you will be able to use Smile CDR 2022.02+ but previous versions of Smile CDR will no longer be able to open the database file.

bin/smileutil upgrade-h2-database-file --url jdbc:h2:file:./database/h2_clustermgr --username SA --password SA

35.12.2Options

 
  • -v [version] (or --fhir-version [version]) – The version of FHIR supported by the server.
  • --url [url] – The JDBC URL for the H2 database
  • --username [username] – The username
  • --password [password] – The password

35.12.3Example

 

You can obtain the database URL, username, and password from your configuration property file. For example, the Smile CDR default configuration contains the following:

module.clustermgr.config.db.url       =jdbc:h2:file:./database/h2_clustermgr
module.clustermgr.config.db.username  =SA
module.clustermgr.config.db.password  =SA

To migrate this database:

bin/smileutil upgrade-h2-database-file --url jdbc:h2:file:./database/h2_clustermgr --username SA --password SA

Note that the default Smile CDR configuration also has a separate database for FHIR storage. To upgrade this:

bin/smileutil upgrade-h2-database-file --url jdbc:h2:file:./database/h2_persistence --username SA --password SA