Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Any way to programatically make a full XML export of a space


is there any way to programatically make (via REST API or groovy script) a full XML export of a Confluence space, in the same way you can do it via web GUI?

In that case, where can I see some examples?

I need to script via cronjob this task, not doing it manually via GUI.




1 answer

1 accepted

Hi @Andrea Vivaldi,

It appears like there's no API that can export a confluence space.
You can support this request here :

I also found a python script (>3.0) by Stephen Deutsch

import requests
import shutil
from time import sleep
from requests import Session
from requests.auth import HTTPBasicAuth
from zeep import Client
from zeep.transports import Transport

user = "admin"
password = "admin"

session = Session()
session.auth = HTTPBasicAuth(user, password)
client = Client('http://localhost:1990/confluence/rpc/soap-axis/confluenceservice-v2?WSDL',

print("Logging in...")
token = client.service.login(user, password)
print("Getting Spaces")
spaces = client.service.getSpaces(token)
numSpaces = len(spaces)
for index, space in enumerate(spaces):
print("Exporting space {} of {} - {} using URL:".format(index+1, numSpaces, space.key))
siteExportUrl = client.service.exportSpace(token, space.key, "TYPE_XML")
filename = siteExportUrl.split('/')[-1]
print("Saving as: " + filename)
r = session.get(siteExportUrl, stream=True)
with open(filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)

Hope this helps!



Thank you very much Lava! It's what I am looking for.

Does it work for Cloud Space export?

Like Paul J_ Hecker likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

494 views 24 9
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you