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.
Will truncating the permission_combination tables not force them to rebuild? Or could they do a rebuild by rebuilding the master caches?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.
$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();
}
$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();
}
That query will sort of work - the permission_combination_id needs to be updated accordingly, which really isn't feasible to do via a query, at least not for everyone. If you know the old combination ID that corresponds to a particular setup and you have the combination ID that matches that setup with a different primary user group ID, then you could change both the group and the combination ID... though there's also a cache in another table too. So all in all, that's a dangerous approach.
I consolidated the users BEFORE I imported them into XF. If IPB has an option to consolidate groups do it on that side first.Wha ....
Damn. That might present a problem. I can't manually move 700 members to another group. Hmmm.
Just ran through this and it workedYes.
If you delete a user group, any members will automatically be assigned to the default Registered user group.
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.Yes.
If you delete a user group, any members will automatically be assigned to the default Registered user group.
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.
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.At waht number it is called "large" number of members within one usergroup? I have some groups, which have 2-3k in it.
We use essential cookies to make this site work, and optional cookies to enhance your experience.