vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   query to move 20,000 members to temp usergroup based upon userid (https://vborg.vbsupport.ru/showthread.php?t=158772)

Antivirus 09-25-2007 10:39 PM

query to move 20,000 members to temp usergroup based upon userid
 
Is the following manual query safe to run to move a large amount of users to a different primary usergroup based upon their userid?

[SQL]
UPDATE user
SET usergroupid = 34
WHERE userid < 24509
[/SQL]

Just want to make sure nothing is missed (settings / data in other tables) when doing such thing through CP
Thanks!

Cars2007 09-25-2007 10:49 PM

Back up your forums first.

I did something like this the other week and it worked just fine.

Antivirus 09-25-2007 10:59 PM

already backed up[, just want to make sure the usergroupid doesn't need to be handled elsewhere. for instance, such as displaygroupid, user title, etc...

Dismounted 09-26-2007 05:37 AM

If you're using the default user title ladder, the usertitle field should be fine.

Marco van Herwaarden 09-26-2007 08:21 AM

:eek:
I hope that you know what you are doing, as the example you provided would move ALL users with a userid smaller then 24509 (including an admin with id = 1 for example???) to this new usergroup.

Paul M 09-26-2007 10:28 AM

You should update the displaygroupid as well (if it's not '0' and is equal to their existing primary group).

Antivirus 09-27-2007 05:41 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1347366)
:eek:
I hope that you know what you are doing, as the example you provided would move ALL users with a userid smaller then 24509 (including an admin with id = 1 for example???) to this new usergroup.

Naturally, actually the query would be as follows:
[SQL]
UPDATE user
SET usergroupid = 34
WHERE userid < 24509
AND usergroupid = 2
[/SQL]

Quote:

Originally Posted by Paul M (Post 1347431)
You should update the displaygroupid as well (if it's not '0' and is equal to their existing primary group).

Ok, thanks that's what i was wondering, if there were any other values that should be updated in tandem.

Thanks to both of you :)


All times are GMT. The time now is 04:53 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02242 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete