Verwijder/schoon/wis verwijderde onderwerpen uit de database

Continuing the discussion from Introducing permanently delete post functionality:

I have a forum where there was a big cleanup. But when reviewing the database backup, it is still polluted with the old soft-deleted data.

Is there some kind of rake command that can be run to purge deleted items from the database?

2 likes

Please Discourse team, make this easier.

The reason I’m active right now is because I am cleaning up my site from thousands upong thousands of topics and posts created by Google auth’ed.

I don’t want the content to be soft-deleted, I want to bulk-permanently delete all the thousands of topics and posts.

I also don’t want to write code or CLI commands.

1 like

Ik heb dit ook onderzocht - omdat ik een heleboel onderwerpen in batches heb geïmporteerd, maar de opmaak was verkeerd - dus ik wil ze in batches verwijderen en het opnieuw proberen.

Ik kan ze wel in bulk zacht verwijderen vanuit de UI, maar ze staan nog steeds in de database. Zacht verwijderde items worden toch uiteindelijk verwijderd, anders blijft de database voor altijd groeien??

Unfortunately there isn’t currently any automatic cleanup of soft-deleted posts, and no manual bulk option in the UI either. The rails console is still the way to approach this if you need to do it.

There are a few topics with some info in about how others have approached it. I think this one may be a good example to get both topics and posts (though will need a tweak to tailor it for your own use case) How to delete thousands of Personal Messages? - #7 by RGJ. And remember to take a backup before trying anything destructive in the rails console as accidents can happen. :slight_smile:

I think this is the relevant Feature request with the most recent activity if you’d like to add your vote and voice to it:

2 likes

Thanks for the feedback - much appreciated!

FYI - I find it amazing that a platform with so many great features doesn’t have any real data retention control. This could represent a regulatory compliance risk for some companies. At a bare minimum, you should at least be able to specify a retention period (in years) for soft-deleted items- as this would help with compliance and capacity management.

I will raise a feature request as suggested :slight_smile:

1 like