The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting all attachments from a space

Tony Rice
Contributor
June 2, 2023

We're retiring a Confluence server, migrating some spaces to another server, but many just aren't updated any more.  We wanted to take snapshots of those spaces for later reference.

We exported each as PDF, a reference to squirrel away somewhere for later.  But that only includes image attachments.  It ignores all other file types.

The XML export does include all attachments, but names the files with their internal ID rather than something more human readable.

So I threw together this Python script which parses the entities.xml file in an XML export, gathering the filenames from there and mapping them to their ids.  It creates a folder named for the space, then sub folders named for each page with an attachment, then copies those attachment files in there.

I hope it is useful to someone else.

https://github.com/rtphokie/confluence_attachment_extract

1 comment

Comments for this post are closed

Community moderators have prevented the ability to post new comments.

Craig Nodwell
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 Champions.
June 3, 2023

Value here!
@Tony Rice thank you sir!

Like Tony Rice likes this
TAGS
AUG Leaders

Atlassian Community Events