@mavila (Marc Avila) posted a new topic, subject "Archiving Data and Files". It read:

   We are trying out the Mattermost team edition and looking for a way to archive/delete messages and files

After which, @amy.blais (Amy Blais) added

    Please see: https://docs.mattermost.com/help/getting-started/organizing-conversations.html#archiving-a-channel.

So @mavila (Marc Avila) replied

    Oh sorry. By Archiving I meant actually removing it from database and not just hiding it.

So @ahmaddanial (Ahmad Danial) replied

    Hello, @mavila
    
    If you are looking at removing messages completely (and automatically), the data retention is the way to go in the long run.
    
    On the other hand, you can manually delete posts in the database that have a `CreateAt` before a certain date as well. Since it is not officially supported, I would recommend you to test this on a staging / development instance first (if possible) before implementing it on the production server. For example:
    [code] 
        DELETE FROM Posts WHERE CreateAt < <epoch_date_time>;
        
    [/code]


{'source': 'discourse', 'url': 'https://forum.mattermost.com/t/archiving-data-and-files/10098', 'title': 'Archiving Data and Files', 'views': 489, 'has_accepted_answer': False, 'word_count': 140, 'like_count': 0, 'reply_count': 1, 'participant_count': 3, 'posts': 4, 'tags': '', 'author': '@mavila (Marc Avila)', 'participants': '@mavila (Marc Avila), @amy.blais (Amy Blais), @ahmaddanial (Ahmad Danial)', 'image_url': [None], 'created_at': '2020-07-15T02:18:45.981Z', 'last_posted_at': '2020-07-22T05:55:34.218Z'}