# Database size handling

**URL:** <https://forum.mattermost.com/t/database-size-handling/2061>\
**Category:** Troubleshooting\
**Created:** [August 11, 2016, 4:15pm UTC](https://forum.mattermost.com/t/database-size-handling/2061 "2016-08-11T16:15:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![azure](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@azure](https://forum.mattermost.com/u/azure)\
**Post date:** [August 11, 2016, 4:15pm UTC](https://forum.mattermost.com/t/database-size-handling/2061/1 "2016-08-11T16:15:26Z")

</div>

I have actively used MM installation (around 150K messages per month) and DB size increasing around 300MB per month.  
For now I don’t see any option to delete old messages from db except total reconfiguration on clean DB instance which is too painful because of channel and hooks reconfiguration.

Is there any other option to do archiving of old data?

---

<div class="post-metadata">

**Author:** ![jwilander](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/jwilander/32/8440_2.png) [@jwilander](https://forum.mattermost.com/u/jwilander)\
**Post date:** [August 16, 2016, 1:09pm UTC](https://forum.mattermost.com/t/database-size-handling/2061/2 "2016-08-16T13:09:40Z")

</div>

Hi @azure,

Mattermost doesn’t currently support this but do any of these feature requests sound like what you’re looking for?

- [Add a way to prune/reset/clear channels](https://mattermost.uservoice.com/forums/306457-general/suggestions/15357861-add-actual-permanent-deletion-on-database-and-fi)
- [Automatically delete the oldest attachments when approaching a set storage limit  
 ](https://mattermost.uservoice.com/forums/306457-general/suggestions/13851123-automatically-delete-the-oldest-attachments-when-a)
- [Add actual permanent deletion - on database AND filesystem level](https://mattermost.uservoice.com/forums/306457-general/suggestions/15357861-add-actual-permanent-deletion-on-database-and-fi)

If so we’d love your help creating a [UserVoice account](https://mattermost.uservoice.com/forums/306457-general) and voting for the features that you would like to see implemented most. Feel free to submit new feature ideas as well if you don’t think any of the existing ones address your issue. The feature requests on UserVoice have a large influence on the features we were work on for subsequent releases.

---

<div class="post-metadata">

**Author:** ![pacuraru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/pacuraru/32/1202_2.png) [@pacuraru](https://forum.mattermost.com/u/pacuraru)\
**Post date:** [May 10, 2017, 2:26pm UTC](https://forum.mattermost.com/t/database-size-handling/2061/3 "2017-05-10T14:26:45Z")

</div>

All 3 of those sound great but if I am not mistaken, there is no solution atm for deleting old messages?  
Does anyone have a brute-force method of emptying the DB somehow? I really need to ensure regular deletion of old files and messages or switch to another product.

---

<div class="post-metadata">

**Author:** ![danilvoe](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@danilvoe](https://forum.mattermost.com/u/danilvoe)\
**Post date:** [May 11, 2017, 11:03am UTC](https://forum.mattermost.com/t/database-size-handling/2061/4 "2017-05-11T11:03:22Z")

</div>

How can we get out of the situation now?  
You can write SCL and then how to understand which invests are no longer needed to be deleted manually by a disc.

---

<div class="post-metadata">

**Author:** ![jasonblais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/jasonblais/32/720_2.png) [@jasonblais](https://forum.mattermost.com/u/jasonblais)\
**Post date:** [May 18, 2017, 3:02pm UTC](https://forum.mattermost.com/t/database-size-handling/2061/5 "2017-05-18T15:02:08Z")

</div>

@pacuraru & @danilvoe: The following feature request for data retention is planned for Enterprise Edition: [https://mattermost.uservoice.com/forums/306457-general/suggestions/10007076-ee-data-retention-and-prune-reset-clear-channel-c](https://mattermost.uservoice.com/forums/306457-general/suggestions/10007076-ee-data-retention-and-prune-reset-clear-channel-c)

It is tentatively scheduled for Mattermost 3.10, which releases on June 16th.

---

<div class="post-metadata">

**Author:** ![danilvoe](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@danilvoe](https://forum.mattermost.com/u/danilvoe)\
**Post date:** [May 19, 2017, 3:57pm UTC](https://forum.mattermost.com/t/database-size-handling/2061/6 "2017-05-19T15:57:21Z")

</div>

How to live with Team Edition ?
