The discussion revolves around deleting 40,000 topics from a Discourse site. The original poster, gerald, is using a browser macro to delete topics in batches of 50, but the site crashes after a few cycles. codinghorror suggests deleting the topics from the command line instead, but gerald lacks the necessary knowledge and thinks the batch delete feature can be improved to handle more topics sequentially. gerald eventually resolves the issue by increasing server power and restarting the browser automation. Alternatively, pfaffman suggests restoring from a recent backup or seeking help from the community or a professional.
I am trying to delete ~40,000 topics from discourse. The method I use is programming a browser macro service https://chrome.google.com/webstore/detail/kantu-browser-automation/gcbalfbdmfieckjlnblleoemohcganoc to go to a specific search page in my Discourse site, click on then select all and click on and click on the red delete-topics button.
I play this macro in a loop so it deletes 50 posts at a time, but after a few cycles, the site crashes.
Is there a better method?
Why is deleting posts such a heavy task for the server?
They were created by a script that publishes wordpress posts that creates a matching discourse topic for every wordpress post.
Unfortunately I don’t have the knowledge how to do this in the command line, but I still think that the batch delete can be improved. For example, it lets you choose up to 1000 topics to edit/delete but it can’t handle such a task, perhaps because it tries to do them all at once. Maybe there is a way to do this more sequentially so the server can handle the load. If I could delete 1000 posts at a time, i wouldn’t have a problem doing it manually via the browser, only 40 time for 40K topics.
EDIT: I increased the server power (to 4 cpus, 4GB ram) and restarted the browser automation and it deleted everything within a couple of hours… so in case anyone reads this in the future, it is something you can do if you don’t have command line experience..