Consolidate 4 Confluence instances with all its users, spaces and attachments
Asked by Philipp Wieseckel:

We would like to consolidate 4 independent confluence Servers to one single Server.

We will need to migrate all Spaces their attachments and Users from the 4 Internal directory's, with their permissions on Spaces and Group Memberships.

Is this possible?

I already found this KB article regarding Group Memberships: <https://confluence.atlassian.com/confkb/migrate-local-group-memberships-between-directories-289277857.html>

But i wasn't able to find a way to export the users to a CSV .

Will the permissions and restrictions be consistent when i export and import spaces?


Answers:
author: Reshma Begum _Appfire_
body: Hi [@Philipp Wieseckel](/t5/user/viewprofilepage/user-id/1187577) ,

With [Confluence Command Line Interface](https://marketplace.atlassian.com/apps/284/confluence-command-line-interface-cli?hosting=server&tab=overview), you can use the [exportSpace](https://bobswift.atlassian.net/wiki/spaces/CSOAP/pages/1068403806/exportSpace) action to export the spaces and then import the spaces into your target instance using [restoreExport](https://bobswift.atlassian.net/wiki/spaces/CSOAP/pages/1068404599/restoreExport) action.

```
--action exportSpace --space "RT" --file RTspaceexp.zip
```

```
--action restoreExport --file RTspaceexp.zip
```

Please make sure to place the file in the home\\restore directory to import.

With respect to migrating users and groups, please use the exportData action as shown below that gives you the list of actions to run in your target instance so as to recreate the users\\groups.

```
--action exportData --space "RT" --exportType "groups"
```

or

```
--action exportData --space "RT" --exportType "users" --options "includeGroups"
```

We have opened a support ticket, [https://bobswift.atlassian.net/servicedesk/customer/portal/1/SUPPORT-6475](https://bobswift.atlassian.net/servicedesk/customer/portal/1/SUPPORT-3079) to better track your request. However, we couldn't add you as a reporter. Please sign up using this link <https://bobswift.atlassian.net/servicedesk/customer/portal/1/user/signup> and share the user name/id. We'll then add you as the reporter and confirm.

Thanks,

Reshma

comments: author: Philipp Wieseckel
body: Hi Reshma, thanks for your support. My mail in you ServiceDesk is philipp.wieseckel@ancud.de

please add me on the Ticket.


author: Philipp Wieseckel
body: Another question would be if there is a way to verify that all Pages and attachments were migrateded?


author: Bipin Nepal
body: HI [@Reshma Begum _Appfire_](/t5/user/viewprofilepage/user-id/2278129) [@Philipp Wieseckel](/t5/user/viewprofilepage/user-id/1187577) can you please add bipin.nepal@cedargate.com to your support request?  

thanks


author: Brant Schroeder
body: [@Philipp Wieseckel](/t5/user/viewprofilepage/user-id/1187577)

I would suggest setting up a new instance and migrating everything to that. This way you could have a blank slate to start from and test against until you get what you want.

All instances will need to be on the same version.

Do you have users in multiple directories? (Same email, username, etc.) This will causes issues and you will need to merge them.

After the new instance is setup and all the directories have been attached you should be able to follow these steps.

1. Export spaces by either:
   1. Individually [Export the desired space as a full XML backup](https://confluence.atlassian.com/doc/export-content-to-word-pdf-html-and-xml-139475.html)
   2. Or per this [community post](https://community.atlassian.com/t5/Questions/Is-there-a-way-to-mass-export-spaces/qaq-p/244098), utilize [Bob Swift's Confluence Command Line Interface (CLI)'s](https://marketplace.atlassian.com/apps/284/confluence-command-line-interface-cli) and its [exportSpace](https://bobswift.atlassian.net/wiki/display/CSOAP/Reference#Reference-exportSpace) action to bulk export spaces to XML
2. [Restore each of the spaces to target Confluence instance](https://confluence.atlassian.com/doc/restoring-a-space-152036.html)

REMINDER: You can't import into an earlier version of Confluence. So if the Confluence instances are on different versions, you may be limited by this and need to upgrade For example, if you export a space from Confluence 5.9, you can't import it into Confluence 5.5.

Also, if the space to be imported is very large, you may need to temporarily increase the memory available to Confluence. See [How to fix out of memory errors by increasing available memory](https://confluence.atlassian.com/confkb/how-to-fix-out-of-memory-errors-by-increasing-available-memory-154071.html)

comments: author: Philipp Wieseckel
body: Thanks Brant!

Sounds like the best approach to me.

We do have users in different directories, all the instances are using their own internal directory right now.


Tags: confluence-server

server