phpBB to bbPress Migration Process - Step 1, Remove Spam Users

We’ve been planning to move to bbPress for quite a while. phpBB is plagued with spam, both through spam user signups and to a lesser extent spam postings. Last time I checked there was no serious anti-spam plugins or modifications available, and the couple of hacky attempts to fix the problem were painful to implement and not particularly effecive.

So we’re now seriously on the path to a bbPress migration, there are some scripts around which will convert a phpBB database to bbPress, but our phpBB currently has 7486 registered users, and I’d say about 300 of those are real people. So before the migration, it’s time to remove the spam profiles.

Here’s a great start, it deletes all “members” who signed up over 48 hours ago and are inactive (haven’t clicked the confirmation link in their signup email).

The SQL looks like this:

[code lang="sql"]DELETE FROM phpbb_users WHERE user_active=0 AND user_id>0 AND FROM_UNIXTIME(user_regdate)… and running it on our database removed 3299 rows, which I would equate to 3299 spam users. That’s a great start, but I’m sure there are plenty more who have actually clicked that confirmation link, so my next move is to remove any users who have 0 posts. This could remove some lurkers who are actually interested in the site. Apologies to those people, but this is a war, and I’m a bastard.
I’m confident enough in my SQL that I don’t need to search around for something to do this, just modify that last SQL command. “user_posts” is where the post count is contained, so here’s what should remove users which are activated but haven’t made any posts: [code lang="sql"]DELETE FROM phpbb_users WHERE user_posts=0 AND user_id>0 AND FROM_UNIXTIME(user_regdate)And lo, it worked. 3316 rows removed. That’s 6615 spam users removed, and our phpBB installation is now showing 828 registered users, which feels about right. I’m sure there’s still some cruft in there, but this is definitely a manageable level, and some manual pruning of 820 users could be feasible, whereas manually going through 7000+ “users” would be utterly painful.Next step: Try the migration from phpBB to bbPress, and research whether we can redirect old orphaned phpBB URLs to the new bbPress hotness.

An aside: The lovely code highlighting in this post was provided with the Code Snippet Wordpress plugin, which I installed because WP was misinterpreting my html <code> blocks.

Related posts

Comment Icon

3 Comments

Josh

You alluded to scripts to migrate from a phpBB to BBPress DB. Got any links to those? Did you complete this migration? How did it go? I’m about to embark on the same migration journey. Any tips or words of caution?

December 20, 2007 @ 11:46 am

jaymis

Hi Josh. Haven’t done so yet, but was hoping to do so over the next week or so. I didn’t save any in my links, but seem to recall I found a couple of different migration scripts with a small amount of googling.

http://www.google.com/search?q=bbpress+phpbb+migration

Whoops. I guess we’ve actually become the top hit on Google for that :)

I was looking at this: http://bbpress.org/forums/topic/importing-from-phpbb
and this: http://bbpress.org/forums/topic/phpbb-gt-bbpress-gt-wordpress

But hadn’t made any more progress than that. If you end up running with them I’d love to hear how it goes. Otherwise I’ll be doing the migration and documenting it soon.

December 20, 2007 @ 11:11 pm

jaymis

… and in a funny quirk of the internet we’re having to turn off comments on this post because we’re getting too much spam and Akismet doesn’t seem to be stopping any of it.

January 30, 2008 @ 10:35 pm
Comment Icon

Sorry, the comment form is closed at this time.

RSS feed for comments on this post. TrackBack URI