Go Back   vb.org Archive > Community Discussions > Forum and Server Management
  #1  
Old 02-16-2016, 07:10 AM
hugh_ hugh_ is offline
 
Join Date: Mar 2005
Location: Netherlands
Posts: 368
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How I dealt with having to delete 1.3 million SPAM registrations

I recently had the experience of cleaning up a forum which was left running vbulletin 3.6.9 for 8 years. With 1.3 million SPAM user account registrations to it's name. I thought it might be worth passing on some how I went about cleaning the place up.

Summarizing a lot of trial and error which isn't worth repeating. The first thing I did was backup the filesystem and database, then took the copies offline. I upgraded to 4.2.3, which took a while but went without a hitch thankfully. Then I started looking into the 'User Moving/Pruning System' which is limited unfortunately, not least in it's search abilities but mostly to 1,000 deletions at a time. I also looked into whether it could be done using SQL queries but apparently not, shame. And 'List Users Awaiting Moderation' might be able to list many thousands of users but it can't do anything helpful with them. Then I found a handy plugin for automating user deletions and usergroup changes which got my hopes up.

However this too is limited to a 1,000 accounts so I set about deleting users manually until it occurred to me to move all the problem accounts to a single usergroup, move a subset at a regular interval using a scheduled SQL query and delete them using the plugin run as a scheduled task. Unfortunately again here here was another limitation in that run as a scheduled task the plugin was unable to delete more than 100 users at a time on my system at least, but still this was it finally a way of deleting 14400 users (or 100 * 6 * 24) per day automatically.

Some other ideas I picked up along the way. If Who's Online is flooded with SPAM users. You might want to make their usergroup invisible. I also blocked all member profiles from all search engines using robots.txt and applied a mod to limit access to certain usergroup's profile pages. Going forward of course the upgraded forum is now using re:captcha2 and has all the relevant user permissions shored up as much as possible.

Anyway here's some of what I picked up along the way. As always backup thoroughly before attempting any of it!

- SQL to make all users in usergroup X invisible:

UPDATE user SET options=options + 512 WHERE NOT(options & 512) AND usergroupid = X

- SQL to move users selectively from one usergroup to another, with the added limitation of only moving users who's name starts with the letters A through F, have more than 1 post and limit the move to a 1,000 user records only.

UPDATE user set usergroupid = X where (usergroupid = Y AND username REGEXP '^[A-Z].*$' AND posts >=1) LIMIT 1000

- User cleanup mod:

https://vborg.vbsupport.ru/showthrea...hlight=cleanup

- Hide profiles mod:

https://vborg.vbsupport.ru/showpost....4&postcount=23

- How to schedule mysql queries:

http://www.mysqltutorial.org/mysql-t...heduled-event/

My schedule:

CREATE EVENT move_users_for_deletion
ON SCHEDULE EVERY 10 MINUTE
STARTS '2016-02-16 06:59:00' ON COMPLETION PRESERVE ENABLE
DO
UPDATE user set usergroupid = X where usergroupid = Y LIMIT 100

And the schedule I'm running for User Cleanup: 10, 20, 30, 40, 50, 00
Reply With Quote
4 благодарности(ей) от:
Kane@airrifle, Lynne, RichieBoy67, SaN-DeeP
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:28 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05377 seconds
  • Memory Usage 2,201KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (4)post_thanks_box_bit
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete