How to export/import effectively in Confluence?
Asked by Support1:

Hello community,

I would like to ask for an advice on the question of effective migration. Let me give you full story in order to get most accurate answer.

So we have going through the company split and we will be moving to different server with Confluence. However we would like to keep 1 space (I already exported the space in XML format) and import it into space that is already created. Is there a way to do it? If not, do you have any suggestions how to effectively migrate/copy pages and articles from the specific space? I would prefer not to do this manually as we have hundrets and hundrets of articles, KBAs with pictures and files.

Thank you for any imput.


Answers:
author: Support1
body: Most of the information [@Dave Theodore \[Coyote Creek Consulting\]](/t5/user/viewprofilepage/user-id/853538) gave is really good to prepare for the migration. I'll add a few things to also think about in addition to that.

First, unlike Jira, the two versions of Confluence do not need to be the same. However, there are some rules: <https://confluence.atlassian.com/doc/restoring-a-space-152036.html>

The first is that you can't import a space from a higher version into a lower version.

The second is that the version of Confluence you are exporting the space from must be 5.3 or greater.

When you are migrating to a new instance, you also need to make sure there isn't a space key conflict. Since Confluence doesn't offer native space renaming capabilities, this can be a problem. So if you are importing space "ABC", and a space with the key ABC already exists, you won't be able to import (without changing the XML).

Think about the users. Are any of the existing users going to be in the new instance of Confluence? All authored content is going to show up as "Unknown User" if it isn't mapped the exact same way. So if the username is John.Smith in the one server, and john_smith in the other server, when you import it won't map the names properly. So you would have to go through the XML and translate it. This is a painful process, since each edit, comment, blog, etc is saved in the XML, and names can appear thousands of times in a space.

If you end up needing to go through the XML and editing certain content, feel free to leave a comment. I just went through a fairly complicated import requiring the renaming of many spaces and remapping users.

comments: author: Support1
body: Thanks for additional information. Most of the users will not be on the new instance of Confluence.


author: Dave Theodore [Coyote Creek Consulting]
body: I'm not understanding the problem exactly, but I think I have the basics on what you are trying to do.

Read the [doc on importing a Space](https://confluence.atlassian.com/confcloud/import-a-confluence-space-724765531.html). It's pretty straightforward. However, you need to make sure that both versions of Confluence are identical. This may mean that you need to install an older version of Confluence, then upgrade.

With regard to migrating content, if you have content that needs to migrate that is spread among multiple Spaces, the easiest thing to do is move all the Pages in to one Space, then migrate that Space. You can use the [Reorder Pages](https://confluence.atlassian.com/doc/move-and-reorder-pages-146407727.html) feature to make it easier. I would create a Page called "Migration" in the Space in question. Then use the Reorder Pages feature to drag all pages that need to migrate on to the "Migration" page. You can then Move the Migration Page to the Space that you will export and you only need to move one page.

Hopefully that helps.

comments: author: Support1
body: It's not really a problem, I am just trying to understand if I am able to do import of space into one that is already in place. However later you mentioned creating page and moving content to that page. Unfortunately this solution is not possible as the space and its content is used by other company and it would be just a mess for them.

Maybe I made it not completely clear, apologies for that. The space and its content has to stay in order, so I can't just move it around. Probably I need to duplicate it and then with duplicate content navigate.


author: Dave Theodore [Coyote Creek Consulting]
body: Got it. You cannot use the Space Import feature to import in to a Space with existing content. You will need to import in to an empty space, then move the pages. I would recommend creating Spaces for this purpose with Keys that are not likely to ever be used by "real" Spaces. Once you use a Space Key, you can never reuse it, even if you delete the original Space. If you pick random character Space Keys for these temp Spaces, you can avoid issues later.


Tags: confluence-server

server