H2 DB - Issues with the migration need from 2.1 to 2.2. And likely again to 2.3?

352 views
Skip to first unread message

Thomas Hurley

unread,
Aug 3, 2023, 8:37:10 AM8/3/23
to H2 Database
hi ,

Posting this as a new conversation.  one of my colleagues posted this recently:  

Fredrik Sjögren
Aug 2, 2023, 4:07:04 PM (20 hours ago) 
to H2 Database
When we have upgraded the h2 library we get following error trying to open the existing databases:

Unsupported database file version or invalid file header in file "/path/to/database.h2.mv.db" [90048-220] 90048/90048

We use a file based database ("jdbc:h2:file:...")

Creating new databases works well.

Has something changed so the files are not compatible?
Any way to get around this in an easy way? The upgrade from version 1 was a hassle for us earlier and we really wish not to do that again.
Is there any way to get more information about why it gets this error?



I am a Product Manager with 3 commercial products using H2 and needing to upgrade.  1 upgraded to 2.1 and we had to go through a migration process to make this seamless to our customers (mostly heavily regulated companies).  This upgrade went ok and no major issues but we invested a lot of engineering time to make sure that worked well for all upgrading customers. 

It now looks like upgrading from 2.1 to 2.2 will require the same effort.  Is that the case? Are you planning to make updates backward compatible or will every upgrade require scripting to migrate data - this is not a feasible solution for me and ask that you make upgrades backward compatible to avoid your customers (and mine) having to customise migration every version upgrade of H2. 

Look forward to your response. 

Andreas Reichel

unread,
Aug 3, 2023, 8:45:28 AM8/3/23
to h2-da...@googlegroups.com
On Thu, 2023-08-03 at 04:27 -0700, Thomas Hurley wrote:
I am a Product Manager with 3 commercial products using H2 and needing to upgrade.  1 upgraded to 2.1 and we had to go through a migration process to make this seamless to our customers (mostly heavily regulated companies).  This upgrade went ok and no major issues but we invested a lot of engineering time to make sure that worked well for all upgrading customers. 

It now looks like upgrading from 2.1 to 2.2 will require the same effort.  Is that the case? Are you planning to make updates backward compatible or will every upgrade require scripting to migrate data - this is not a feasible solution for me and ask that you make upgrades backward compatible to avoid your customers (and mine) having to customise migration every version upgrade of H2. 

Look forward to your response. 

Greetings!

We are in a similar situation, having multiple H2 Databases on our servers and need to upgrade all of those smoothly when we deploy newer versions of our software.
Also, NOT upgrading H2 is never really an option since all the provided fixes are valuable and needed.

That's why we wrote the Migration Tool. It can convert whole (recursive) directories with all DBs in it  and we integrated it directly into our software.

Upgrading from 2.1 to 2.2 was a minor task for us. We did not notice any incompatible features.
Biggest issue (for us) is that CTEs are completely broken since 2.1.212 and return no rows (without throwing errors). As long as you don't use CTEs, you should be good.
If you use CTEs you may need to refactor your queries (We use JSQLParser for this.)

Good luck and cheers
Andreas


Reply all
Reply to author
Forward
0 new messages