How to export a space using CLI
Asked by Hayath Khan K:

How to export a space using CLI


Answers:
author: Adam Martin
body: [@Sudhir_Appfire_](/t5/user/viewprofilepage/user-id/416862)

So, after you've exported a space from Cloud with [exportSpace](https://bobswift.atlassian.net/wiki/spaces/CSOAP/pages/1068403806/exportSpace), how is that then re-imported to Cloud? (besides through the UI)

The [action restoreExport](https://bobswift.atlassian.net/wiki/spaces/CSOAP/pages/1068404599/restoreExport) appears to only be viable with Server/DC.


author: Tihomir Nikolov _Nemetschek Bulgaria_
body: Hi, is seems that the issue [SUPPORT-2906](https://bobswift.atlassian.net/servicedesk/customer/portal/1/SUPPORT-2906) is not public, so is it resolved ?

Is there a way to automate export and restore actions for Confluence cloud?

The purpose is to migrate a bunch of spaces between two cloud instances.

Thanks in advance.

comments: author: Dileep Kumar Katta
body: Hi [@Tihomir Nikolov _Nemetschek Bulgaria_](/t5/user/viewprofilepage/user-id/541334)

We are from the Appfire support team.

We have opened a Support Request

<https://appfire.atlassian.net/servicedesk/customer/portal/11/SUPPORT-90137>

for this issue. Could you please try to access the above ticket and signup to our portal for further discussion on this ticket.

Regards,  
Dileep


author: Sudhir_Appfire_
body: Hi [@Hayath Khan K](/t5/user/viewprofilepage/user-id/1984421)

We are from BobSwift support team.

We have opened a Support Request [SUPPORT-2906](https://bobswift.atlassian.net/servicedesk/customer/portal/1/SUPPORT-2906) for this issue. Could you please try to access the ticket [SUPPORT-2906](https://bobswift.atlassian.net/servicedesk/customer/portal/1/SUPPORT-2906) and signup to our portal for further discussion on this ticket.

You can export a space using CLI by following below steps:

1. Download the CLI for the client by downloading latest atlassian-cli-8.8.0-distribution.zip from [here](https://bobswift.atlassian.net/wiki/spaces/ACLI/pages/16875586/Downloads)
2. Go to atlassian-cli-8.8.0 folder and run the below command using --action **exportSpace**

```
?./confluence.sh --server <confluence url> --user <username> --password <password> --action exportSpace --space "<space key>"  --file "<path where to export the file>/exportSpaceHtml.zip"  --exportType "HTML"
```

Please let us know if you have any questions and we are happy to assist you.

Regards,  
Sudhir

comments: author: Beer Mohamed
body: [@Sudhir_Appfire_](/t5/user/viewprofilepage/user-id/416862) Thanks for the details about export.. I see there is an action **restoreExport** but it seems like we have to get into target server and run it, is there any possibility to provide target instance url and run it from source instance itself.

Also I tried **copyspace** action where we can provide target url but I can see only spaces are copied there not pages and other details of it..

Could you help me on this.

Thanks

Mohamed


author: DPKJ
body: You will need CLI tools for confluence ([https://marketplace.atlassian.com/apps/284/confluence-command-line-interface-cli?hosting=cloud\&tab=overview](https://marketplace.atlassian.com/apps/284/confluence-command-line-interface-cli?hosting=cloud&tab=overview))

Once you get this you can follow examples listed on this page - <https://bobswift.atlassian.net/wiki/spaces/CSOAP/pages/10584066/Examples>


Tags: bob-swift

cli