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

## <span style="color: #000000">Instructions</span>

<span style="color: #000000">Use the </span>**<span style="color: #000000">c</span>****<span style="color: #000000">opySpace </span>**<span style="color: #000000">action to copy a space with </span>*<span style="color: #000000">space and newSpace </span>*<span style="color: #000000">as required parameters</span>*<span style="color: #000000">    </span>*

<span style="color: #000000">Execute the following action copies the current space, </span>*<span style="color: #000000">CLI</span>*<span style="color: #000000">, to new space, </span>*<span style="color: #000000">COPYCLI</span>*<span style="color: #000000">:</span>

```
--action copySpace --space "CLI" --newSpace "COPYCLI" --name "CopySpace_CLI" --description "Creation of CopySpace_CLI" --copyBlogs --copyAttachments --copyLabels --copyComments --copyPermissions --continue
```

![image](media://74340157-d9f5-4869-8580-bf07b89162ae)

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

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

<span style="color: #000000">The above action contains the following parameters: </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">: Creates a new space and copies pages to the new space. Other information can also be copied based on other parameters. By default, find-replace logic applies only to content. To apply the find-replace logic to the title, use </span>*<span style="color: #000000">--options applyFindReplaceOnTitles</span>*<span style="color: #000000">.</span>
- *<span style="color: #000000">space</span>*<span style="color: #000000">: Space key. For some actions, a space name may also work.</span>
- *<span style="color: #000000">newSpace</span>*<span style="color: #000000">: New space key for the copied or moved page.</span>
- *<span style="color: #000000">name: </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">copyBlogs</span>*<span style="color: #000000">: Copy blogs when copying a space.</span>
- *<span style="color: #000000">copyAttachments: </span>*<span style="color: #000000">Copy attachments when copying a page.</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: #000000">copyPermissions: </span>*<span style="color: #000000">Copy permissions when copying a page or space. Source permissions replace existing target permissions. Note Confluence page permissions are copied as restrictions.</span>
- *<span style="color: #000000">continue: </span>*<span style="color: #000000">Continue processing even after errors are encountered for </span>**<span style="color: #000000">run</span>**<span style="color: #000000"> actions. Also used for some actions to ignore certain errors like not found errors on remove actions.</span>

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