Getting error while migration

Hi ,
I need a help on this .

While i was trying to migrate the database form H2 to Mariadb any version (10.1 and 10.3)
i am getting the below error
Transfering 4077 instances of FieldValues…BatchUpdateException:
Message: Data truncation: Data too long for column ‘values’ at row 1
SQLState: 22001
Error Code: 1406

Can any one please suggest the work around!!


Hi @sushant.naik
Try changing the column from the default TEXT (64KB) to MEDIUMTEXT (16MB) with this SQL command:
ALTER TABLE `metabase_fieldvalues` CHANGE `values` `values` MEDIUMTEXT;
You might need to do that with multiple columns, since changing in one place might have consequences elsewhere.
And then you run the migration again.

Hello @flamber,

Thanks for the suggestion on work around, these changes should be done in source/destination data source.
In my case H2 database is the source and destination will be Mariadb.
Why i am asking is, if its in the destination source , to do that i need to create the tables prior to migration, if i do so application will through error like “table_name” already exists .

That change is made in MariaDB.
I’m using MariaDB 10.3 and migrated a couple of months ago from H2, but I’m pretty sure that I let the migration wizard run once, which then created the structure, but data migration failed. I then made the changes to MariaDB and then I ran the migration again and it automatically skipped the structure and just imported the data.
I might be totally off, but it’s the middle of the night and I’m very tired, so I cannot help you until tomorrow.

Ya sure please … Have a good rest .

Thanks as per the suggestion i have modified the datatype of the columns text to MEDIUMTEXT of the table “metabase_fieldvalues” in mariadb . Now its successfully migrated .