How do I delete all confluence spaces?

we need to host separate Confluence for one of our teams and so I am planning to take a snapshot of existing confluence db and remove the existing spaces except one required space. So I wanted to remove nearly 100 spaces. Can I remove all spaces in one shot instead of manually removing spaces?

2 answers

1 accepted

This widget could not be displayed.

Confluence Command Line Interface has removeSpace action which would make it faster and easier for you. You can use this in conjunction with one of the run actions like runFromList.

Hi Bob, Will the below action work or do I have to use only with runFromList?

confluence --action runFromSpaceList --common "--action removeSpace --space @space@"

It got SocketTimeoutException when I executed the above command.

Remote error: ; nested exception is: Read timed out

That should work, but, you said you wanted to delete all but 1 space and that will delete them all. How quickly did you get the timeout? There is a connectionTimeout parameter you can use to increase the timeout, but, I wouldn't have expect you would need that. Can you complete getSpaceList? If so, can you delete the first space on the list without a timeout?

It is ok to delete all spaces so I tested with the command. I observed SocketTimeOut exception while deleting every space..

c:\Srinivas\atlassian-cli-3.8.0>confluence --action runFromSpaceList --common "--action removeSpace --space @space@"

Run: --action removeSpace --space Space1

Remote error: ; nested exception is: Read timed out

Client error: 1 actions failed

Ok, perhaps the space is very large and taking too long to complete. So, set a much higher timeout on the remove space action. --connectionTimeout 0 should go forever.

I have one question. Can we delete all personal spaces also using CLI tool?

Yes, runFromSpaceList has an option to include personal spaces. It is off by default. Use --personal to include them in the list.

This widget could not be displayed.

Hi Atlassians, Any comments please?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

532 views 7 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you