The discussion revolves around batch operations for moving or deleting topics in Discourse, particularly after importing data from phpBB. Canapin asks how to move or delete topics from one or multiple categories, including subcategories, and notes issues with updating message counts and moving the “about this category” topic. pfaffman suggests modifying the category and topic importers to skip unwanted categories, though Canapin prefers avoiding re-importing. The user also references a Meta Discourse guide on merging categories and finds a solution in the administrative bulk operations guide.
I usually create an array with the category ID that I don’t want and modify the category importer to skip those categories and makes sure that the topic importer skips topics if the category doesn’t exist.
Which file(s) should I modify? Is such a modification quick and straightforward or does it need work to be functional?
If I can avoid re-importing my forum I’d prefer though.
Also, I noticed that after moving some posts with Topic.where(category_id: XX).update_all(category_id: YY) the number of messages was not updated and it seems that it couldn’t be either from sidekiq tasks. Also, it moved the “about this category” topic which can’t be deleted.