Load-from-h2 failure with Galera

Hi. I got weird error when migrating metabase app DB from H2 to mariaDB.
Could anyone support and share insights how to resolve it ... ?

What happened?

Got error message "ERROR Re-enabling DB constraints...".

2022-05-02 17:05:17,301 INFO db.setup :: Database Migrations Current ...  ✅
Database setup took 21.1 s
2022-05-02 17:05:17,302 INFO cmd.copy :: [OK]
2022-05-02 17:05:17,303 INFO cmd.copy :: Testing if target mysql database is already populated...
2022-05-02 17:05:17,314 INFO cmd.copy :: [OK]
2022-05-02 17:05:17,327 INFO cmd.copy :: Temporarily disabling DB constraints...
2022-05-02 17:05:17,331 INFO cmd.copy :: [OK]
2022-05-02 17:05:17,338 INFO cmd.copy :: Copying instances of Database...
2022-05-02 17:05:17,364 ERROR cmd.copy :: BatchUpdateException:
 Message: (conn=928490) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
 SQLState: 08000
 Error Code: 0

2022-05-02 17:05:17,365 INFO cmd.copy :: Re-enabling DB constraints...
2022-05-02 17:05:17,365 ERROR cmd.copy :: [FAIL]

Command failed with exception: Rollback failed handling "ERROR Re-enabling DB constraints..."

The errored code looks here.

When it happened?

Running java -Dlog4j2.debug=true -jar ~/metabase.jar load-from-h2 ./metabase.db

Detail system info

Version of metabase generating source H2 file ( metabase.db.mv.db )
v0.32.9

Version of metabase.jar

  • v0.32.9 -> failed
  • v0.42.3 -> failed
  • v0.42.4 -> failed

Destination Database : MariaDB Galera Cluster ( version 10.5.12 )

Connection URI ( Tried the parametes part with/without combinations. Nothing resolved.)
MB_DB_CONNECTION_URI='jdbc:mysql://{DBHOST}:{DBPORT}/metabase?user={DBUSER}&password={DBPASS}&characterEncoding=UTF-8&elideSetAutoCommits=true&useMysqlMetadata=true&usePipelineAuth=false'

Hi @Toma
Metabase currently doesn't support Galera officially, so perhaps it's something to do with that.
Try loading into a "regular" MariaDB, and then you can copy the data to Galera after that.
Also, do not try to upgrade and migrate at the same time:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html#avoid-migrating-and-upgrading-at-the-same-time