Cannot insert duplicate key in object 'dbo.Spaces' encountered when importing a space from Confluence Cloud site

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When importing a space which was exported from a Confluence Cloud site, you encounter a "Unique key constraint 'UK_jp1ad5yufsih5r7lqrygakpug'. Cannot insert duplicate key in object 'dbo.Spaces'. The duplicate key value is ()" error message.

(Auto-migrated image: description temporarily unavailable)

Cause

CONFCLOUD-64563 - Space export may export multiple spaces

Solution

  1. Open a Cloud support ticket and engage them to address CONFCLOUD-64563 - Space export may export multiple spaces for this site

  2. Re-export the Cloud space

  3. Delete any previously partially-failed imported spaces in the target environment

  4. Re-import the Cloud space

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.