MyBB Community Forums

Full Version: Move users to new user group
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all

I have one simple (but I don't know the solution) question. How to move all users, who have more than 5 posts to new user group.

I can sort users bu posts, but for changing primary group I need to modify each user. But I have 4500 users.... and more than 500 have more than 5 posts and I want them to move new user group.

With Group Promotions - It promotes only users, who posting after enabling this task. So old user with 200 posts will remain to old user group, until he makes new post. But I want some faster solution, to change the primary group.

Thanks
I think you can set a group promotion in your ACP.
I tested this and as the OP said, it only then promotes people who post after. You can do it with an SQL query but I'm not sure if the promotion should do this or not.
Only those who post after you set the promotion option will be move to the new group. As the post above suggests you can do this by running a query in the database.

Something like UPDATE mybb_users SET usergroup = 'new_usergroup_id' WHERE postnum > 4
Make sure that you add another conditional to this statement because it will move all users with more than four posts to the new user group... including Admins and Super Mods and Mods and all other groups... I guess that would be a bad thing
(make sure this query is correct before you run it, if something is wrong with it I won't be held responsible Smile )

But I would question why you need to do that. Those people are inactive and if they become active then once they post they will be updated....
Thanks - this works.

I only moved with this update all adminstrators and moderators also to new user group, but I fix it easly from phpMyAdmin

(2009-03-29, 10:51 AM)Abu Sabah Wrote: [ -> ]Only those who post after you set the promotion option will be move to the new group. As the post above suggests you can do this by running a query in the database.

Something like UPDATE mybb_users SET usergroup = 'new_usergroup_id' WHERE postnum > 4
Make sure that you add another conditional to this statement because it will move all users with more than four posts to the new user group... including Admins and Super Mods and Mods and all other groups... I guess that would be a bad thing
(make sure this query is correct before you run it, if something is wrong with it I won't be held responsible Smile )

But I would question why you need to do that. Those people are inactive and if they become active then once they post they will be updated....
The query should have been this:

UPDATE `mybb_users` SET `usergroup` = 'new_usergroup_id' WHERE `postnum` > '5' AND `usergroup` = 'old_sergroup_id'

Then it's specific about what the current group has to be.
I'm glad it worked out for you spottraining and thanks Matt for the correct SQL statement.