Database migration fails due to duplicate entry

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

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

Cause

This problem can occur if:

  • the target database is case insensitive.
  • the target database has not been created with the correct collation.

Resolution

If the 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.  

 

 

 

 

 

 

 

 

 

 

 

 

 

Last modified on Jun 8, 2015

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.