Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Space and Key from DB

Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2019

Hi,

As I wanted to import a single space to a confluence server instance, whenever I tried to import it getting below error..

Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: org.hibernate.exception.ConstraintViolationException: could not execute statement

So i tried to delete the space from DB, but I'm unable to do...

ERROR: update or delete on table "spaces" violates foreign key constraint "fklmweu06nft59g7mw1i1myorys" on table "content"
DETAIL: Key (spaceid)=(31391745) is still referenced from table "content".
********** Error **********

ERROR: update or delete on table "spaces" violates foreign key constraint "fklmweu06nft59g7mw1i1myorys" on table "content"
SQL state: 23503
Detail: Key (spaceid)=(31391745) is still referenced from table "content".

 

1 answer

1 accepted

0 votes
Answer accepted
Steve Thornhill
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2019

Is the original space still active? If so, delete that through Confluence first.

Alternatively, if you are not too bothered by the actual Key on the import you can update this in the xml file before importing.

Deleting from the database should be avoided if possible due to the links between tables as you have seen.

Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2019

Hi @Steve Thornhill 

Thanks for the response.

I have followed the below Atlassian article and the problem has been resolved.

https://confluence.atlassian.com/confkb/importing-a-space-fails-with-could-not-execute-statement-error-in-confluence-server-949242294.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events