How to export and import multiple spaces from one instance to other

Deleted user June 24, 2020

I want to move multiple spaces from one instance to another instance on another server. Also there is version difference as well (moving from 6.13 to 6.8). I have tested the export and import by doing it one at a time but i want to know if I can do all the spaces in one go since there are so many of them.

 

Also, will it move users associated with those spaces automatically or not. 

 

Thanks for any assistance. 

3 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2020

You will have to do it one by one (unless you're willing to completely destroy the target and get nothing but a copy of the entire source system).

One trick that might help - consolidate your source spaces together, then de-consolidate after merge. 

Deleted user July 1, 2020
0 votes
Sebastian Weise
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2023

I was facing the same issue. No API to do the task...

So i am using a custom built Selenium script in Powershell to perform the task.
What i do is open the all spaces page, scroll down until the web element with all spaces is populated, fetch all spaces and their keys, then open a new tab in chromedriver for each space and enter this URL:
"xyz.atlassian.net/wiki/spaces/exportspacewelcome.action?key=XYZ"

Then press buttons accordingly and trigger download, then wait for completion status, for example like this:
"[int]$completionElement = (SELChromeMGM -SELGetElements $True -ChromeDriverName "ChromeDriver1" -SELocatorType "Id" -SELocatorValue "percentComplete").Text"

And if it reaches 100, click the download button, close tab, until all tabs / spaces have been processed and are closed.
Then move the HTML exports to our storage.

The only problem i see with the workflow as of now, is you can only trigger 1 export per account it seems. When i was finished scripting, and let the loop run through, i figured that much:
"The following error(s) occurred:
Already running this task."

But it should be easy to bypass, simply by either using multiple service accounts to perform the task, or wait till one export is done, then do the next.

I made sure that for the web elements i am using attributes that hopefully do not change, or only change rarely, and wrapped everything in a try and catch, and check content before every step. So time will show how often i have to change something, but as of now, it is running since some weeks without any further a do.

I hope that gives you some ideas on how to solve it. ;)

Bests
Basti

PS: This helped to check for workflow/task status outside the chromedriver instance:
https://community.atlassian.com/t5/Confluence-questions/Terminate-existing-Space-export/qaq-p/2259886

0 votes
sanan sanan
Contributor
June 7, 2022

Hi, @Nic Brough -Adaptavist- ,

 

I am having same task coming up in few days to migrate around 80+ spaces from once Confluence server to another running production instance.

I will like to try your suggestion of consolidation of source spaces at the source instance . can you please describe what you mean? as I understand, I need to move all the spaces from their top page into once single space , migrate that single space to target space and then move out all those spaces (taking the top for the respective page). am I right? please correct me if understood wrong.

 

regards

sanan

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2022

Let's imagine you have a simple Confluence with three spaces:

  • Space-1
  • Space-2
  • Space-3

To consolidate, you can

  • Create Space-consolidate
  • Create pages S1, S2, and S3 in that space
  • Move all the top-level pages, with children, from Space-1 under the page S!
  • Move all the top-level pages, with children, from Space-2 under the page S2
  • Move all the top-level pages, with children, from Space-2 under the page S3

Now you can export and import Space-consolidate, then, when it is imported, create new spaces in the target and move all the top-level pages into them.

Like Mandar likes this
sanan sanan
Contributor
June 7, 2022

Hi, @Nic Brough -Adaptavist- 

thanks a ton for a detailed instructions.

I think my understanding was correct. But its always better to have confirmation from an expert :) 

regards

sanan

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2022

Yes, I think your understanding was correct too!  You did ask for a description, and I thought a short worked example would confirm your thinking.

sanan sanan
Contributor
June 7, 2022

and that was indeed very helpful @Nic Brough -Adaptavist- 

Now I can proceed with this solution in confidence.

the reason I want to go with this solution is that I have seen in past when you import multiple spaces, sometimes the import breaks due to some multiple db entries of already imported spaces...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events