---
title: "How to copy space between two different Confluence instances"
canonical: "https://support.appfire.com/space/SUPPORT/89142857/How%20to%20copy%20space%20between%20two%20different%20Confluence%20instances"
format: markdown
---
<span style="color: #000000">This article explains how to copy a space from one instance to other instance using the </span>*<span style="color: #000000">Confluence Command Line Interface (CLI)</span>*<span style="color: #000000"> app.</span>

> ⚠️ **Important Information**
> ⚠️ 
> ⚠️ Ensure that the source instance must have the CLI Connector installed with a valid license. A connector or a valid license is not a requirement for the target instance.

## Instructions

<span style="color: #000000">Use the</span><span style="color: #000000"> </span>**[c](https://appfire.atlassian.net/wiki/spaces/CSOAP/pages/68458335/copySpace)****[opySpace](https://appfire.atlassian.net/wiki/spaces/CSOAP/pages/68458335/copySpace)**** **<span style="color: #000000">action to copy space with </span><span style="color: #000000">*space, targetServer, targetUser, targetPassword *</span><span style="color: #000000">and</span><span style="color: #000000">* name *</span><span style="color: #000000">as required parameters.</span>

<span style="color: #000000">As an example, let's copy the current space,</span><span style="color: #000000"> </span>*<span style="color: #000000">CopySpace_CLI,</span>*<span style="color: #000000"> with key, </span>*<span style="color: #000000">COPYCLI</span>*<span style="color: #000000">, to another Confluence instance with space name,</span>* TARGET_CLI. *<span style="color: #000000">The copied space in the target instance retains the same space key,</span>*<span style="color: #000000"> COPYCLI. </span>*

<span style="color: #000000">Execute the following action:</span>

```
--action copySpace --space "COPYCLI" --targetServer "http://confluence.destinationinstance.com" --targetUser "admin" --targetPassword "admin" --name "TARGET_CLI"  --description "copied space" --copyComments --copyLabels  --descendents


```

![image](media://37786f3e-6df0-4a5b-8e9f-c1fdd0a97ee1)

<span style="color: #000000">The result of the above action is as follows:</span>

- <span style="color: #000000">Output on the terminal:</span>
- <span style="color: #000000">Output in Confluence:</span>

  
<span style="color: #000000">The above action contains the following parameters: </span>

- *<span style="color: #000000">copySpace</span>*<span style="color: #000000">: Creates a new space and copies pages to the new space. Other information can also be copied based on other parameters. </span>
- *<span style="color: #000000">space:</span>*<span style="color: #000000"> Space key value. For some actions, a space name may also work.</span>
- *<span style="color: #000000">targetServer:</span>*<span style="color: #000000"> Target server URL for copy requests.</span>
- *<span style="color: #000000">targetUser: </span>*<span style="color: #091e42">Target server user. Defaults to user.</span>
- *<span style="color: #091e42">name</span>**<span style="color: #091e42">: </span>*<span style="color: #000000">Space name or file name for the attachment.</span>
- *<span style="color: #000000">description: </span>*<span style="color: #000000">Descriptive text.</span>
- *<span style="color: #000000">targetPassword</span>*<span style="color: #000000">: </span><span style="color: #091e42">Target server user password. Defaults to password.</span>
- *<span style="color: #000000">copyLabels: </span>*<span style="color: #000000">Copy labels when copying a page or space.</span>
- *<span style="color: #000000">copyComments: </span>*<span style="color: #000000">Copy comments when copying a page.</span>
- *<span style="color: #091e42">descendents</span>*<span style="color: #091e42">: </span><span style="color: #091e42">All descendents for a page.</span>

> ℹ️ <span style="color: #000000">It is recommended to test this scenario in a non-production environment before implementing it in production environment.</span>