Best method for auditing/archiving/deleting attachments on Confluence?
Asked by Rory Aptekar:

Our Confluence Server instance is starting to see some significant increase over the past few months with attachment usage, and I'm a bit unsure of the best way to go to get an idea of how we can either go through and delete/archive attachments that haven't been accessed in x period of time or even get an idea of attachment storage per user so we can reach out to the teams they belong on to validate that all the data they've uploaded is still necessary.

Any advice on what's worked with attachment analytics or archival to help ensure we aren't just retaining stale data or being able to get on overview of the biggest attachments/etc?


Answers:
author: AnnWorley
body: Hi Rory,

I don't have a way to report on attachments by user but you can start by finding the largest attachments and seeing whose pages they are on: [How to find the largest attachment files in your Confluence instance](https://confluence.atlassian.com/confkb/how-to-find-the-largest-attachment-files-in-your-confluence-instance-779295552.html)

Also, on this page: [How to get more statistical data (disk space, contents created) from Confluence's usage](https://confluence.atlassian.com/confkb/how-to-get-more-statistical-data-disk-space-contents-created-from-confluence-s-usage-830284173.html) there is a query to find the total size of attachments (in bytes) in all pages / blogs in each space.

Hopefully you can extrapolate who the users are from the permissions on the larger spaces.

Please let me know any follow up questions.

Thanks,

Ann

comments: author: Rory Aptekar
body: Thanks Ann - this should be helpful to start with!


author: AnnWorley
body: A colleague saw your question and let me know about this query that will identify files that are used in more than one place. If you see anything unusual in the results it could indicate a page with lots of attachments being copied multiple times, etc:
>
> SELECT title, COUNT(title)  
> FROM CONTENT   
> WHERE contenttype = 'ATTACHMENT'  
> GROUP BY title  
> HAVING COUNT(title) \> 1  
> ORDER BY COUNT(title) DESC;


author: Rory Aptekar
body: Thanks again - we'll run the queries to see what we can come up with in the short term.


author: Jaime Sotelo Trujillo
body: Hello jhon.

My question focuses on how the data deletion process is carried out on cloud platforms after unsubscription and the retention period ends. What methods do they use? how is the proccess?regards.


author: Darin - Opus Guard
body: [@Rory Aptekar](/t5/user/viewprofilepage/user-id/1140720) it sounds like you may want to consider an auto delete/purge feature and having an ongoing automation with a retention policy. Putting Confluence pages/blog posts into the Archive still counts against your total storage. Additionally, for compliance, Archive/Deleted content is still recoverable by users and considered discoverable to auditors.

Check out [Content Retention Manager for Confluence](https://marketplace.atlassian.com/apps/1233769/content-retention-manager-for-confluence?hosting=cloud&tab=overview) in the Atlassian Marketplace. It's intended to be simple and straightforward content retention management that helps clean spaces up and help with ISO/SOC2 compliance at the same time. It also has the feature of marking content to live on beyond the retention period for stuff too good to purge.


Tags: attachment

confluence-server