manticore-projects / H2MigrationTool

A software tool for migration of an old H2 database into a new H2 database format automatically.
https://manticore-projects.com/H2MigrationTool/index.html
GNU General Public License v3.0
34 stars 3 forks source link

Using CLI not getting migrated #13

Closed DevPrayag8158 closed 8 months ago

DevPrayag8158 commented 11 months ago

by using H2MigrationTool-1.4-all.jar try to upgrade db from 1.4.197 -t 2.2 .220 version then getting following issue

java -jar H2MigrationTool-1.4-all.jar -l /home/prayag/keycloak/both/h2/bin -l /home/prayag/keycloak/both/22/h2/bin/h2-2.2.220.jar -f 1.4.197 -t 2.2

.220 -d /home/prayag/keycloak/keycloak-17.0.0/data/h2/keycloakdb.mv.db -u sa -p password /home/prayag/keycloak/newdb.mv.db Exception in thread "main" java.lang.Exception: Failed to migrate the database. at com.manticore.h2.H2MigrationTool.main(H2MigrationTool.java:561) Caused by: java.lang.Exception: No H2 driver found for requestion version 1.4.197 at com.manticore.h2.H2MigrationTool.getDriverRecord(H2MigrationTool.java:429) at com.manticore.h2.H2MigrationTool.getDriverRecord(H2MigrationTool.java:647) at com.manticore.h2.H2MigrationTool.migrate(H2MigrationTool.java:806) at com.manticore.h2.H2MigrationTool.main(H2MigrationTool.java:551)

manticore-projects commented 11 months ago

Greetings,

thank you for using the tool.

1) Please use 1.5-SNAPSHOT which has H2 1.4.197 included (I just checked)

2) then use

java -jar H2MigrationTool.jar -f 1.4.197  -t 2.2.224 /home/prayag/keycloak/keycloak-17.0.0/data/h2/keycloakdb.mv.db -c ZIP -o VARIABLE_BINARY --force

This works as a JUnit test.

manticore-projects commented 11 months ago

I have just tried myself from CLI:

with 1.4

are@archlinux ~> java -jar Downloads/H2MigrationTool-1.4-all.jar -f 1.4.197 -t 2.2.224 -d ~/CommandLineTest_1.4.197.mv.db

Dec 18, 2023 7:37:24 PM com.manticore.h2.H2MigrationTool migrate
INFO: Found H2 DB /home/are/CommandLineTest_1.4.197 which will be exported to SQL Script
Dec 18, 2023 7:37:24 PM com.manticore.h2.H2MigrationTool migrate
INFO: Wrote H2-1.4.197 database to script: /home/are/CommandLineTest_1.4.197.sql
Dec 18, 2023 7:37:25 PM com.manticore.h2.H2MigrationTool migrate
INFO: Created new H2-2.2.224 database: /home/are/CommandLineTest_1.4.197

with 1.5

are@archlinux ~ [1]> java -jar Downloads/H2MigrationTool-1.5-SNAPSHOT-all.jar -f 1.4.197 -t 2.2.224 -d ~/CommandLineTest_1.4.197.mv.db

Dec 18, 2023 7:37:12 PM com.manticore.h2.H2MigrationTool migrate
INFO: Found H2 DB /home/are/CommandLineTest_1.4.197 which will be exported to SQL Script
Dec 18, 2023 7:37:12 PM com.manticore.h2.H2MigrationTool migrate
INFO: Wrote H2-1.4.197 database to script: /home/are/CommandLineTest_1.4.197.sql
Dec 18, 2023 7:37:13 PM com.manticore.h2.H2MigrationTool migrate
INFO: Created new H2-2.2.224 database: /home/are/CommandLineTest_1.4.197.mv.db.224
manticore-projects commented 11 months ago

There should be no need for the -l parameter since all the H2 versions are included.