Exporting and importing a space in Confluence
Asked by Liam Nicholls:

We are writing documentation for a version of our product. Once the product is released, we would like to freeze the documentation and no longer alter it.

We would then like to be able to copy the space so that we can start documenting a new version of the product and modify only parts of the documentation that are required.

**Does anyone have any ideas on how this could be approached?**

(1) I believe at the moment it is not possible to clone a space?

(2) We were thinking we could export the space, and then reimport the space. However that will probably overwrite the existing space. I also don't think it is possible to modify the space key - which may have been useful.

(3) Perhaps manually modify the XML before import could work? If the key = XXX, could we search and replace XXX and change to YYY, that way we would have a new space imported and it would have a different key. Possibly a bit risky approach?


Answers:
author: Liam Nicholls
body: I tested the manual method as detail on this page:

[http://confluence.atlassian.com/display/DOC/Copy+Or+Rename+A+Space#](http://confluence.atlassian.com/display/DOC/Copy+Or+Rename+A+Space)

I was able to export the space XML. Then manually find and replace the SpaceID and the Space name. Then I imported this XML as a new space in Confluence. Please note I am using Confluence OnDemand so the use of a plugin for this is not an option.

I recommend you test this method before embarking on a massive Confluence space cloning task!


author: Lillia
body: Hi all :) We also use COD and I also need to copy a space but obviously the plug-in is not an option.

The link Liam mentioned [http://confluence.atlassian.com/display/DOC/Copy+Or+Rename+A+Space#](http://confluence.atlassian.com/display/DOC/Copy+Or+Rename+A+Space) no longer has info on it? can someone point me to a page with the manual method referred to?

Thanks

Lillia.

comments: author: Michael Faux
body: Any luck getting the manual method to work?  
I'm trying to:

* Export a space
* Change the space key to an unused space key
* Import the space

I get an error message, "The zip file did not contain an entry...".

I've tried a simple test, and still no luck:

* I created a new space
* Made one page with some lorem ipsum
* Exported the space
* Unzipped the export
* Renamed the space keys in entities.xml and exportDescriptor.properties to an unused space key
* Zipped the folders up
* Attempted to import - fail

I came across an Atlassian article saying to use 7Zip or WinZip instead of Windows build-in zip utility; I've tried all three zip programs and the import failed for each.


author: Sam Cogheil
body: Looks like the issue is because Windows and 7Zip puts the Folder inside the zip (subfolder) - if you zip up a folder.

Instead go into the Folder. Select the files - right click and create the Zip file. The resulting zip file should have the necessary files at the root.

Sam

comments: author: Shannon S
body: Be aware, if you were to do this on MacOS it includes invisible files and can cause an issue importing.

In that case, I would recommend doing the zip via Terminal and explicitly list the required files.

For example:

```
zip -r archive-name.zip entities.xml exportDescriptor.properties attachment/
```

Regards,

Shannon


author: Lillia
body: I'ts ok I'm blind missed the links on that page to previous doco.


author: Liam Nicholls
body: I've tested the method detailed in [http://confluence.atlassian.com/display/DOC/Copy+Or+Rename+A+Space#](http://confluence.atlassian.com/display/DOC/Copy+Or+Rename+A+Space)

It entails export the space XML, and the replacing the Space ID and the Space name with a new unused Space ID and Space name. Seemed to work ok for me.


author: Jeff Kirby
body: You need the Confluence Copy Space Plugin

<https://plugins.atlassian.com/plugin/details/212>

comments: author: Liam Nicholls
body: Ah yes - but we are using Confluence OnDemand, so our Plugin options are limited.


author: Liam Nicholls
body: I've actually just found some info on manually modifying the XML

<http://confluence.atlassian.com/display/DOC/Copy+Or+Rename+A+Space#>

Any other thoughts on this? Perhaps some people have tried this technique before?


Tags: cloud

confluence-cloud

export