How-To Delete the Contents of a Large Forum
by
22 Sep 2009
How To Delete the Contents of a Large Forum At some point, many of us prune older threads in order to keep our database size manageable. The most obvious way to delete a large forum (containing many threads, subforums, subsubforums, etc -- you get the idea) seems to be this: AdminCP -> Forums & Moderators -> Forum Manager That seems to work for smaller forums. Unfortunately, according to my own experience and several other reports on this site, vbulletin.com, and others, this doesn't work for anything big. When I tried to delete a large forum representing just over half of my post table, total MYI file size ~2 GB, the script ran for almost 4 hours and then failed silently. It did unsubscribe people from the forum (and subforums), but not from the threads, nor did it delete anything (or, if it did, the amount of deletion performed was negligible). I found no trace of any error messages. vBulletin support suggested that I go in and delete the subforums individually by hand. Unfortunately, there were over a thousand of them, and the interface is clunky at best. Spending the next 2 weeks deleting forums for 8 hours a day just wasn't going to work out. To automate this job, one should instead start go to: AdminCP -> Threads & Posts -> Prune And prune threads. In our case, with a ~5 GB database and 4 GB of memory, I could process about 2000 threads at a time with successful completion. For me, this meant stepping through the thread 50 to 100 days at a time through its history (your rate of thread addition will likely be different, but the same general approach can be applied). Once the forum I wanted to remove had less than about 10,000 threads in it (including in subforums), I was able to remove all of the rest of it the officially prescribed way, using forum manager. And that's it! Sounds pretty simple, but if I'd run across a post containing this information earlier this weekend, I'd have saved hours of my time. |