Confluence migration from Cloud to Cloud
Asked by Dimitrina Ivanova:

Client needs and scope {#toc-hId--471429453}
--------------------------------------------

We had to make a partial migration of confluence data from one cloud to another.

The Atlassian documentation guided us to use server instance as a middle step of the confluence cloud-to-cloud migration - <https://confluence.atlassian.com/cloudkb/migrating-from-confluence-cloud-to-confluence-cloud-691011969.html>. This approach was not applicable in our case due to intellectual property issues and other problems that we have identified. Also, from our previous experience with similar procedures, we know that not everything goes as smoothly as expected when a large amount of data is moved around.

Atlassian is currently working on a confluence migration tool, but it is not ready yet, and we cannot wait for it.

So we decided to manually transfer the data in XML format. As we had a list of dozens of spaces that had to be migrated, we had to automate the whole process and we came up with the procedure described below. The process that we finalized, in brief, was to bulk export the spaces with ACLI, import them using Python script and verify the results.

Preconditions: {#toc-hId-2016083380}
------------------------------------

* The users should be migrated in advance.
* Confluence CLI plugin installed on both source and target confluence instances.
* ACLI client installed on the OS where migration is executed from (Windows in our case).
* Python 3 and Selenium module
* Chrome installation
* Chromedriver (the same version as Chrome)
* autoIt3 installation (In the environment path variable need to be included path of the autoIt3 installation folder)

Export spaces {#toc-hId-208628917}
----------------------------------

* The command to run a script:

acli --action run --file "export_spaces.txt" \>\> export.log

* The script export_spaces.txt contained individual commands for every space, e.g.:

--action exportSpace --space "MySpace1" --file "C:\\ExportSpaces\\MySpace1.zip"

Import spaces {#toc-hId--1598825546}
------------------------------------

1. The Python script we used is based on Selenium libraries and AutoIt3 script. It automatically logs in to the Confluence cloud using a user with admin privileges and imports the previously exported spaces - exactly the way a user would do it if it was manually run from the admin panel. The keys of all projects that were imported were taken from a separate file containing the Spaces and their related Jira projects. As Selenium can't interact with windows dialogs the AutoIt3 script is used instead during the import process.
2. Validation -- Checking the console output for errors or the log where the output is redirected.

Verification {#toc-hId-888687287}
---------------------------------

Verified with getPageList command for every exported space on the source and on the target instances using a script that contains a separate command for each space like:

acli --action getPageList --cql "space= MySpace1" --outputFormat 2 --file "space_ MySpace1.log"

Note {#toc-hId--918767176}
--------------------------

We started the export with another command, but it turned out that it does not copy the history of the pages and all pages are shown as created by the user that executes the command.

acli --action copySpace --space "MySpace" --targetServer "<https://target.atlassian.net>" --name " MySpace " --description "copied space" --copyBlogs --copyAttachments --copyLabels --copyComments --copyPermissions --continue


Answers:
author: Dimitrina Ivanova
body: Hello [@Amelie Winkler _Appfire_](/t5/user/viewprofilepage/user-id/4980398) , i apologize for the delayed answer. I would love to talk to you.

Will be available after the 29th of May, we could schedule a call then.

Thanks,

Dimitrina


author: Amelie Winkler _Appfire_
body: Hi [@Dimitrina Ivanova](/t5/user/viewprofilepage/user-id/5141910) -- Amelie from Appfire's product team here. Thanks for sharing this inspiring use case!

We'd love to learn more about how you're using the CLI. Would you be open to jumping on a quick call to chat about it?

Cheers, Amelie


Tags: confluence-cloud

cli

cloud

cloud-migration

migration

moderators