PDA

View Full Version : Mass moving users to another usergroup sql query?


kevin.kool
07-07-2011, 01:23 PM
Hello guys, I'd like to ask about sql query to massive move all users from a usergroup (ex Group A) to another usergroup (Group B). :confused:

Thank you all.

kh99
07-07-2011, 02:48 PM
You could change the primary user group with this query:

UPDATE user SET usergroupid = B WHERE usergroupid = A

(you need to add your table prefix to 'user' if you have one).

But changing the group might result in a change in user title or rank (which I think you can do by running "update user titles and ranks" in the "update counters" section of the Maintenance menu).


Another option might be to add a promotion from group A to group B and set the conditions so everyone qualifies (such as strategy "Posts" and 0 Posts), then run the "User Promotions" scheduled task (run it manually by pressing "Run Now" - if you wait for it to run itself it will only promote users who have been active recently).

Badshah93
07-07-2011, 02:49 PM
you can use Vbulletin Prune/Move Users to move user.

or

SQL QUERY

UPDATE user set usergroupid = GroupB_ID where usergroupid = GroupA_ID;

In place of GroupB_ID -> enter groupb usergroupid.
In place of GroupA_ID -> enter groupa usergroupid.


oops - i m late..

kh99
07-07-2011, 03:03 PM
oops - i m late..

But I didn't realize you could do it with "Prune/Move Users" - that sounds like the right way to go.

kevin.kool
07-08-2011, 02:24 AM
Thank you guys :) Both of posts are helpful for me.