Getting a 'Duplicate key or integrity constraint violation' During XML Import

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When migrating to MySQL from another database, such as HSQL, importing the site backup often fails with an error like this:

Duplicate key or integrity constraint violation message from server

Cause

Such errors occur because usually MySQL evaluates unique key constraints and primary key constraints in a case insensitive way. So if you have a space with the key "sp" and another with the key "SP", MySQL will refuse to add the second one.

Resolution

This problem is avoidable by setting the collation on the database to be case sensitive.


Last modified on Mar 30, 2016

Was this helpful?

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