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

XF 1.5 Permissions - category and a LOT of private forums, performance

I am migrating a large forum from vbulletin 4.2 to Xenforo. One of my issues is a special category of private forums - 1 category and more than 170 forums, each having it's own usergroup (each group can see only one forum). Migration is going fairly well, although I am surprised with a terrible performance of permission rebuilds on each change to the nodes.

What is the best way to set up this category and it's children from performance point of view? I want to have the category hidden unless the user has a right to one of the children, but it doesn't work like I expected.

Migration from Vb had this set up like this:

- registered users - revoke
- all usergroups - not set (no)
Private Forums:
- all usergroups - not set (no)
- select usergroup - Allow

I thought this will work, but it doesn't - users don't see the category nor the forums. I'm afraid that if add 170 groups to the category it will slow down the permissions recount on each modification I do...


XenForo moderator
Staff member
Having that many user groups is always going to slow the process down - XenForo sacrifices time during rebuilds to increase performance at runtime.

Revoking the view permission for the parent category will override the explicit allow for any child nodes, so the easiest way is probably to allow it for the category for each user group and make each child forum a private node.
@Brogan, one more question - can I run a simple query to make every subforum of a forum with id=X a private forum and then run permission rebuild? Or can you tell me how to set those forums as provate in vbulletin to have them imported properly? I need to somehow speed up a process of setting 200 forums as private for this migration. I have proper groups already assigned.


XenForo developer
Staff member
Unfortunately, there aren't queries to do it as it's a very complex process internally and I'd have to recommend doing it within XenForo. Permissions can't always be imported 100% accurately as different software packages represent things differently or have different functions.
@Mike - sorry for bothering and pushing, but I was experimenting and came up with something that SEEMS to work. Again - my goal is to set 200 sub-forums of a specific forum to Private. I know it is unsupported, but can you think of something that may be screwed up if I run the following query to set each subnode of a node#93 to private?:
INSERT INTO xf_permission_entry_content  SELECT '','node',node_id,0,0,'general','viewNode','reset',0 FROM xf_node WHERE parent_node_id = 93;
It inserts a unique row (there is an index that forces uniqueness) into xf_permission_entry_content with group_id=0 and user_id=0 and permission_id=0. After this I needed to update one of the sub-forums (resave) and all permissions seem to be renewed properly, saving me hours and hours of clicking and waiting (each permission renewal takes at least 3 - 4 minutes on my test server).


XenForo developer
Staff member
As long as the caches are built as necessary, that may suffice. I'd note that this is perhaps a specific case as depending on exactly what's being inserted, it could lead to additional permission combinations being generated, etc.