H2 to Mysql

hi guys,

I tried to convert H2 database to Mysql …but I have this error

‘Command failed with exception: (conn=54) Duplicate entry ‘33-SCH_UNIBI-VIEW_DATA_LS_VENDA_EXP’ for key ‘idx_uniq_table_db_id_schema_name’’

Metabase: 0.33.5.1
SO: Windows

Hi @wsca
Are you upgrading and migrating at the same time? If yes, then first upgrade, then migrate.
Which version of MySQL?
The specific constraint was added in version 0.32.0 (changeset 98), so it would be interesting if you did not encounter this problem while on H2.

I already update

My MySQL version is:

sql-version

@wsca
Do you have multiple tables in the datasource database, which have the same name?
Specifically schema SCH_UNIBI and table VIEW_DATA_LS_VENDA_EXP.

Try removing the constraint idx_uniq_table_db_id_schema_name from the table metabase_table on MySQL.

ALTER TABLE metabase_table DROP CONSTRAINT idx_uniq_table_db_id_schema_name;

And then run the migration again.

That’s work @flamber:grinning:

Thank you very much !!!

@wsca Just reference - there’s an issue open on problems with the constraints, so it will be fixed in the future:
https://github.com/metabase/metabase/issues/10087