Database migration fails due to duplicate entry
Error message when migrating the database (e.g. from HSQL to MySQL):
... 76329 rows written, 40 tables completed. 76336 rows written, 41 tables completed. Database error at cru_user:121 (table:row) of the input: Duplicate entry 'abc' for key 2 Duplicate entry 'abc' for key 2 Database migration failed: java.sql.BatchUpdateException: Duplicate entry 'abc' for key 2
This problem can occur if:
- the target database is case insensitive.
- the target database has not been created with the correct collation.
collation column is not shown as
utf8_bin, you need to recreate the database with the correct collation. For more information, refer to our database migration documentation.