Restore a Confluence space export under a different space key--options?
Asked by Wesley Fok:

We're in the middle of moving all our documentation to a new instance of Confluence Cloud after a corporate separation. Most of our documentation was contained in a space on the old Confluence wiki that we had full export permissions for, so that was no problem to bring into the new space. The problem is some API documentation that was hosted in a space we didn't have export permissions for.

Eventually we managed to get those pages copied over to the space we had export permissions for, and made a second export containing just those pages. However, there appears to be no good way to import this into our new Confluence instance. Because the export has the same space key as the pages we've already imported, it looks like Confluence won't import the file as-is. The suggestion in the docs is to move the pages into a new space and import that instead, but we also have no permission to create new spaces on the old Confluence.

The best option I can think of at the moment is to either a) move all the wiki pages in our NEW Confluence to a temporary space, import the new export file to the existing space, move those pages to a new permanent home, then move the original wiki pages back; or b) with a throwaway email address, start a new Confluence trial, import the XML file to THAT space instead, move the files into a new space, re-export to XML, then import that into our current space.

Neither option seems very direct and I don't know if there are any gotchas to opening a throwaway trial account for this purpose. Are there any better options?


Answers:
author: Wesley Fok
body: (never mind, I don't understand how thread replies work here!)


author: Alexey Matveev
body: Hello,

You can find information on how to change the key of a space during import here:

<https://confluence.atlassian.com/confkb/how-to-copy-or-rename-a-space-in-confluence-169578.html>

comments: author: Wesley Fok
body: Ah! The manual XML modification looks like that might work well for us. The only trick is that we're on Confluence Cloud, so we can't really fire up a test server to test the XML changes on. Is there another way to test our XML modifications?


author: Zak Laughton
body: Hi Wesley!

Atlassian's recommended method for testing on cloud is to set up an instance on the smallest user tier ($10/month): [Atlassian Cloud: staging and testing environment](https://confluence.atlassian.com/confeval/other-atlassian-evaluator-resources/atlassian-cloud-staging-and-testing-environment). You can also take advantage of the [7-day free trial](https://confluence.atlassian.com/confeval/other-atlassian-evaluator-resources/atlassian-cloud-staging-and-testing-environment).


author: Wesley Fok
body: Today I tried modifying the backup files to change the space key and imported the backup into a fresh Confluence instance. The space imported fine, but when I try to import that same backup into my existing Confluence instance I get the following error at the very end of the process:

com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: org.hibernate.exception.ConstraintViolationException: could not execute statement

This happens both with the original ZIP I uploaded to the test Confluence instance (with the space key modifications) and with a new space export I took from the test Confluence instance. I also tried importing with a connected Jira project and without one.


author: Alexey Matveev
body: Try to connect to Atlassian Support. Atlassian can tell you exact errors:

<https://getsupport.atlassian.com>


Tags: cloud

confluence-cloud