• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Mass moving people from one usergroup to another

MGSteve

Well-known member
#1
What's the best way to do this - with an eye on the current outstanding out-of-memory bug if you delete a usergroup with a lot of users in it?

I have too many usergroups at the moment and I want to shrink them down when we move to XF, this means either doing the leg work in VB3.8 or in XF.

Can you even change people's usergroup membership en-masse in either system? What's the best way to do it?
 

MGSteve

Well-known member
#3
It's not straightforward.

You can do it via SQL, but you need to update the permission combination too: http://xenforo.com/community/thread...ed-when-deleting-usergroup.10311/#post-140385

My recommendation would be to do it before importing.
I thought it wouldn't be as straight forward as a query. I appreciate this isn't the vB forum, but given people's experience with it - how easy is it to do (and how is it done) in vB, I've never tried to do something like this before in vB.
 

Brogan

XenForo moderator
Staff member
#4
I don't think many have done it, if at all.

Primarily because it's not possible via the ACP to mass move from one group to another.
You can delete the group and the members of that group will default to the Registered group, but that's all you can do.

So the only way to really do it is via SQL, and then you've got the issue of getting all the queries correct.
 

MGSteve

Well-known member
#5
I don't mind doing queries, but its the hidden side effects that concern me (as Mike noted in a similar thread).

*sigh* I guess we'll have to wait for either Mike to post a script that we can use as a base to go from & fill in the various blanks so it can delete the usergroups out & handle the updates correctly, or wait until they add it into the ACP.

I can't help but think that alot of people will want to do what we're trying to do when they bring over a medium to large site over to XF. Our forum has been going for 10 years, there's a lot of spring cleaning to do!
 

akia

Well-known member
#6
Could you not just use the user group promotion tool. To do it. I.e if member of old group longer than a day promote to new group.
 

MGSteve

Well-known member
#7
Could you not just use the user group promotion tool. To do it. I.e if member of old group longer than a day promote to new group.
Doesn't it just add them to that group though, rather than move them?

Actually thinking about it, you may well be right... I'll give it a go.
 

MGSteve

Well-known member
#8
Actually thinking about it, this would only work when they logged in, wouldn't it? Is there a way to force through usergroup promotions instantly for more than one user?
 

akia

Well-known member
#9
I thought it did it as a cron on vb, I know in the past when I've made changed like that I've just clicked to run the task a few times to get all the changes to go through, as it does them in batches.
 

EasyTarget

Well-known member
#10
What's the best way to do this - with an eye on the current outstanding out-of-memory bug if you delete a usergroup with a lot of users in it?

I have too many usergroups at the moment and I want to shrink them down when we move to XF, this means either doing the leg work in VB3.8 or in XF.

Can you even change people's usergroup membership en-masse in either system? What's the best way to do it?
MGSteve:

I just wrote a series of sql scripts that will do this on the vb side before importing them into XF.
Like Brogan stated, you would then need to adjust the usergroup permissions on the XF side to make sure everything lines up the way you want it.

Mainly what I did was force almost everyone into registered member, then handled the special cases like mod, super mod, etc..
 

MGSteve

Well-known member
#11
I thought it did it as a cron on vb, I know in the past when I've made changed like that I've just clicked to run the task a few times to get all the changes to go through, as it does them in batches.
Yeah, I just checked out the Cron section in the ACP - you can run them on demand... as long as it doesn't time out when promoting 50,000 users or so, it should work ;)
 

MGSteve

Well-known member
#12
MGSteve:

I just wrote a series of sql scripts that will do this on the vb side before importing them into XF.
Like Brogan stated, you would then need to adjust the usergroup permissions on the XF side to make sure everything lines up the way you want it.

Mainly what I did was force almost everyone into registered member, then handled the special cases like mod, super mod, etc..
Yeah, that will be the backup plan, I'll try the plan by akia above first.
 

MGSteve

Well-known member
#13
hmm, that didn't work out so well, I got a 500 Internal server error when I ran the cron job manually.

LOL,

Allowed memory size of 134217728 bytes exhausted (tried to allocate 91 bytes) in /home/xxxxx/xxxxx_html/library/Zend/Db/Statement/Mysqli.php on line 304, referer: http://xxxxxxx/admin.php?cron/
Back to the drawing board. (pardon the pun)