SQL query to assign user group to all memners

Do it the easy way.

Create a usergroup promotion with some arbitrary criteria such as "User State Is: Valid" that promotes them to the desired usergroup.

That would effectively make everybody a member of the usergroup. unless they are awaiting approval. In which case, as soon as they are approved or have confirmed their e-mail they will get automatically promoted anyway.
 
I'm about to migrate my vBulletin forum this week. All members will be members och the group registered. Then I also want them all to become members och the member group. So this is something that should effect all members.
 
Do it the easy way.

Create a usergroup promotion with some arbitrary criteria such as "User State Is: Valid" that promotes them to the desired usergroup.

That would effectively make everybody a member of the usergroup. unless they are awaiting approval. In which case, as soon as they are approved or have confirmed their e-mail they will get automatically promoted anyway.
It turns out that I was a little bit fast in verifying the result last time. The usergroup promotion is not working as expected (probably because I'm doing something wrong).

These are the criterias that I use:

usergroup_promotion.webp

When criteria is true the user will be member of the usergroup member. Am I missing something here?
 
Are you trying to put all registered group users into the members group?

If so the second usergroup option is unnecessary. It won't attempt to promote someone to a usergroup they're already in.

Explain in detail what you're trying to do and I'll help you come up with the right options.
 
My permission system is based on the groups registered, member and premium. All new members get the membership of registered right away. After ten pre-moderated posts they are transferred to the member group with "normal" account restriction for that type of group. In this scenario when I'm migrating my forum I want all existing users to become member of the member group. That's really what I'm trying to achieve.
 
Ok. From the beginning.

Assuming all existing users are in the "registered" group already...

1) Admin CP > Users > User Group Promotions > Create New Promotion
2) Title: Whatever. Add user to groups check: "Member"
3) Apply this promotion while: User state = Valid
4) User is a member of any of these groups = Registered

And that's it.

That should promote any user currently in the Registered group to be also in the Member group.
 
This is important:

Note that the cron only updates users who have been active in the last 72 hours, so there may be a delay for some users despite manually running the cron.

There's a code edit to get around that. Would be good to make that code change now to get done what you need to, then revert it back to normal.

I don't know where the code edit is. Like all good things, it was posted by Jake so I will see what I can find.

EDIT: It's ok, I have worked it out myself.

Back up this file: library/XenForo/CronEntry/UserGroupPromotion.php

And replace it with the one attached.
 

Attachments

Top Bottom