Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,364,036
Community Members
 
Community Events
168
Community Groups

Can't delete duplicates in user_mapping table with NULL lower_username

While exporting a space and importing it into another instance, it is reporting an error that points to the duplicate entry for user name error as described in (https://confluence.atlassian.com/confkb/confluence-site-xml-import-fails-with-duplicate-key-error-438993638.html).

The above KB says to delete the entry with a NULL lower_username entry. However, when I try to do that, it fails because of a foreign key constraint:

mysql> delete from user_mapping where user_key='0c9f4cdb7f34bb56017f5329e889013b';
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`confluence`.`CONTENT`, CONSTRAINT `FK_CONTENT_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`))

How do I fix this? I looked at the CREATOR column of the CONTENT table, but values are all NULL.

I think the source of the problem is that we are migrating Spaces from a defunct  source environment and those migrations have users in the Spaces that don't have accounts in our  destination environment.  I suspect that those users are 'created' with the NULL lower_username.  Then when we create the actual user accounts, they have the same username, but because the accounts are created 'normally' they have the correct lower_username, hence the duplication? 

Now that those Spaces are in our environment, our exports of them fail to import elsewhere (e.g., a test instance).  Note that we do not want to export/import the entire Confluence, just specific spaces.

Any suggestions appreciated.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.13.7
TAGS

Atlassian Community Events