Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in Intelij h2 config The write format 1 is smaller than the supported format 2, spring boot app

While trying to connect H2 data source by URL in Intelij, following error occurs:

The write format 1 is smaller than the supported format 2
like image 694
Tohid Makari Avatar asked Nov 23 '25 05:11

Tohid Makari


2 Answers

Switching to the right version fixed my problem.

To fixed it in Intelij, version of H2 driver should be changed as following config: In the Intelij, click on Data source config then in Drivers tab select H2 database. enter image description here

like image 123
Tohid Makari Avatar answered Nov 24 '25 22:11

Tohid Makari


H2 2.*.* cannot open database files created by H2 1.4.200 or older versions, you need to export them to SQL with the version that was used to create these files into SQL script (for example, with SCRIPT TO 'filename.sql' command), create a new database with the new version of H2 and populate it with data from this script (for example, with RUNSCRIPT FROM 'filename.sql' FROM_1X command).

See also the documentation: https://h2database.com/html/tutorial.html#upgrade_backup_restore

H2 2.*.* has a helper class org.h2.tools.Upgrade, it can be used by applications to upgrade their databases.

There is also a third-party upgrade tool: https://github.com/manticore-projects/H2MigrationTool

like image 32
Evgenij Ryazanov Avatar answered Nov 24 '25 22:11

Evgenij Ryazanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!