I kind of abandoned the Wiki4Games BBS lately, and when I got back to it I noticed that, as you can guess, it had been invaded by spammers (here are some of their IPs: 220.127.116.11, 18.104.22.168, 22.214.171.124 – don’t worry, the full list is at StopForumSpam). One of them, a subtle ass from China, had literally flooded the board with about 340 topics, so moving them all into my hidden trash board one by one seemed a bit of a long option.
I didn’t find a ready-made function in SMF to move all those topics manually, and I didn’t want to install a plugin for that (not sure if there is one, though), so I ended up messing with the database manually. This is fairly easy indeed: topics are listed in the
smf_topics table. Their board and author is specified there. So, for moving all topics by a user into a specific board, all you need to do is find the ID of the member (that’s easy, it’s in the URL of their profile, for instance my spammer is member #155: http://bbs.wiki4games.com/index.php?action=profile;area=summary;u=155) and the ID of the board where you want to move their messages (again, that’s in the URL when you view the aforementioned board).
And then, to move all topics, the query is simply:
UPDATE smf_topics SET id_board=6 WHERE id_member_started=155
(replace 6 and 155 by the IDs of the target board and member, of course)
Note that in order to update the board listing page with the proper last post of the board, you’ll need to move a topic back and forth into the said board (or make a post and then delete it), if one of the topics you moved via MySQL was the last post of said board.
That’s it, some time saved again, you’re welcome 😉