How to clean up old media uploads from Mattermost?
-
Does anyone know how to do this?
The one way I thought it might work is to configure an external media store, maybe Minio and age them out somehow.
Still need a way to clean up what's internally stored.
-
Yes, data retention policy is only part of enterprise - https://docs.mattermost.com/administration/data-retention.html
-
@robi I found this guide in one of the forums - https://gitlab.com/InstitutMaupertuis/mattermost-old-messages/blob/master/README.md . Use with care, since I have no clue what it does.
-
Wow, what a horrible design for maintenance.
Thanks for finding it.I'm not interested in editing the DB.
As long as I find where the files are, I can clean those up without removing the messages and references.Looks like I found just that at /app/data/files/.
A visit via the new File Browser in the Cloudron App Config/Console easily finds the few large attachments.
Another thing I noticed is that MM generates preview and thumbnail images for some reason, which more than doubles the storage requirements for each image uploaded. Some of the generated preview images are larger than the original uploads

-
We tested it by adding this Cron:
@monthly find /app/data/files/ -type f -name "*.mp4" -mtime +60 -delete
The purpose was to remove all videos with the extension .mp4 that are older than 2 months.
We have no idea if it's working or not. We can't see anything in the logs.If anyone know how to improve the Cron please let me know

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login