1. 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 users to a group

Discussion in 'XenForo Questions and Support' started by Rho Delta, Oct 18, 2011.

  1. Rho Delta

    Rho Delta Well-Known Member

    Is there a way to mass move users to a user group but not all users? I hate going into each profile to move them the a private group, I have about 150 members I need to move.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    No, there currently isn't an option to do that.

    It has been suggested.

    BTW, you shouldn't be moving members from the Registered user group, you should just be adding them to others as secondary groups.
     
    erich37 likes this.
  3. CyclingTribe

    CyclingTribe Well-Known Member

    Is there a query we can use to move members of one group to another?

    I'm consolidating my usergroups before migration in IPB, but some of them cannot be merged until after they're in XF.

    Cheers,
    Shaun :D
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You can't do it using queries as the permissions sets need to be updated, and the values are calculated based on all the user groups the user is a member of.
     
  5. CyclingTribe

    CyclingTribe Well-Known Member

    Wha .... :eek:

    Damn. That might present a problem. I can't manually move 700 members to another group. Hmmm.
     
  6. Robbo

    Robbo Well-Known Member

    Will truncating the permission_combination tables not force them to rebuild? Or could they do a rebuild by rebuilding the master caches?

    Bulk editing of certain things is something that is definately missing.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    I don't think so.

    I think the only way to do it is to do 1 member and check the permission set value, then you can write a script to mass move and update all other members, assuming their user groups and permissions are identical.
     
  8. Robbo

    Robbo Well-Known Member

    A simple script could do this actually. In a model somewhere...

    PHP:
    $users $this->_getDb()->fetchCol('SELECT user_id FROM  xf_user WHERE user_group_id = ?'number here);
    foreach (
    $users as $userId)
    {
        
    $dw XenForo_DataWriter::create('XenForo_DataWriter_User');
        
    $dw->setExistingData($userId);
        
    $dw->set('user_group_id'another number here);
        
    $dw->save();
    }
    That would be just changing a user group id but you get the gist of it. First query is where you put a query for all your users. Also this is jsut for primary group, would need some changes for secondary groups.

    And now I have thought of a better way. Do your query on your server and then force a rebuild of all permission sets.

    PHP:
    $users $this->_getDb()->fetchCol('SELECT user_id FROM  xf_user');
    foreach (
    $users as $userId)
    {
        
    $dw XenForo_DataWriter::create('XenForo_DataWriter_User');
        
    $dw->setExistingData($userId);
        
    $dw->rebuildUserGroupRelations();
        
    $dw->rebuildPermissionCombinationId();
    }
    This could be completely wrong btw. I'm just bored.
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    This is what Mike had to say: http://xenforo.com/community/thread...ed-when-deleting-usergroup.10311/#post-140385


     
  10. EasyTarget

    EasyTarget Well-Known Member

    I consolidated the users BEFORE I imported them into XF. If IPB has an option to consolidate groups do it on that side first.
     
  11. Rho Delta

    Rho Delta Well-Known Member

    You could have a checkbox by all names in the member list and have a mass option dropdown box that says like add users then it will bring up an option of what usergroup to add them to. Just a thought, that would make life peachy.
     
  12. Robbo

    Robbo Well-Known Member

    I would say XenForo will have bulk features some time in the future. I invision tools having various bulk modifying features. I also don't see it as something that is important enough to see any time soon. Just hope an addon developer has a need for something like this and makes it for you.
     
  13. CyclingTribe

    CyclingTribe Well-Known Member

    I've consolidated a number of groups and will probably just merge everything into the Registered group and use promotions to give higher privs.

    It'll work out ... :D
     
  14. Dean

    Dean Well-Known Member

    I also need to move thousands of users from one user group to another... I will get back to this.
     
  15. ChemicalKicks

    ChemicalKicks Well-Known Member

    I'm kinda stuck unless anyone has any suggestions, I would like to move to the cumulative permissions system XenForo uses. Unfortunately when I was running VB I dealt in absolutes, I wouldn't use secondary groups, you just got your primary usergroup changed.

    At the moment I have as a base group

    Registered Users

    The next group with more permissions is called

    TNL

    =================

    I need to get all those TNL users moved to Registered User as their primary group, if I delete the TNL group will everyone move as I require them to?
     
  16. Brogan

    Brogan XenForo Moderator Staff Member

    Yes.

    If you delete a user group, any members will automatically be assigned to the default Registered user group.
     
    ChemicalKicks likes this.
  17. ChemicalKicks

    ChemicalKicks Well-Known Member

    Just ran through this and it worked :)
     
  18. Dean

    Dean Well-Known Member

    Mike warned me that may not work with a large number of members in a group.. I am making the changes manually. Taking a while but almost done.
     
  19. snoopy5

    snoopy5 Well-Known Member

    At waht number it is called "large" number of members within one usergroup? I have some groups, which have 2-3k in it.

    Also what can I do i.e. with banned users. I have for example after an import 6 different banned member groups of 6 different vb forums. How can move them in the default banned member group of XF?
     
  20. Dean

    Dean Well-Known Member

    Keep in mind that XF was being improved at a fast pace when this thread was last posted to, so from a technical standpoint my post you quoted is probably quite meaningless.

    My vague recollection is that I wanted to be 100% certain that people went into the correct group, so I went into each persons account and manually changed it. Which was a good thing from a user management standpoint because I had found several things I needed to address over the years that I had forgot to do. People requesting things which I had responded to, site changes that I had not made but meant to, several accounts that needed disabling because those people were never going to post again and it would not be a good thing for them to get emails from my site anymore in case someone started a Conversation with them...

    I really do not understand the last part of your post. It almost sounds like you have 6 independent vb forums with 6 separate databases and you are merging them?
     

Share This Page