How to recreate the Confluence Internal User Directories
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
In case the internal user directories is accidently deleted, you can follow the steps below to recreate the internal user directory.
Solution
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Here's the list of steps that you will need to take to recreate the internal directory and user in Confluence:
Remember to backup your Confluence database dump before running any of the queries below.
Shutdown Confluence.
Run these queries to recreate the directory:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
INSERT INTO cwd_directory (id,directory_name,lower_directory_name,created_date,updated_date,active,description,impl_class,lower_impl_class,directory_type) VALUES (327681,'Confluence Internal Directory','confluence internal directory','2015-02-08 15:02:53','2015-02-08 15:02:53','T','Confluence default internal directory','com.atlassian.crowd.directory.InternalDirectory','com.atlassian.crowd.directory.internaldirectory','INTERNAL'); INSERT INTO cwd_directory_operation (directory_id,operation_type) VALUES (327681,'CREATE_GROUP'), (327681,'CREATE_ROLE'), (327681,'CREATE_USER'), (327681,'DELETE_GROUP'), (327681,'DELETE_ROLE'), (327681,'DELETE_USER'), (327681,'UPDATE_GROUP'), (327681,'UPDATE_GROUP_ATTRIBUTE'), (327681,'UPDATE_ROLE'), (327681,'UPDATE_ROLE_ATTRIBUTE'), (327681,'UPDATE_USER'), (327681,'UPDATE_USER_ATTRIBUTE'); INSERT INTO cwd_directory_attribute (directory_id,attribute_value,attribute_name) VALUES (327681,'atlassian-security','user_encryption_method'); INSERT INTO cwd_app_dir_mapping (id,application_id,directory_id,allow_all,list_index) VALUES (360449,294913,327681,'T',0); INSERT INTO cwd_app_dir_operation (app_dir_mapping_id,operation_type) VALUES (360449,'CREATE_GROUP'), (360449,'CREATE_ROLE'), (360449,'CREATE_USER'), (360449,'DELETE_GROUP'), (360449,'DELETE_ROLE'), (360449,'DELETE_USER'), (360449,'UPDATE_GROUP'), (360449,'UPDATE_GROUP_ATTRIBUTE'), (360449,'UPDATE_ROLE'), (360449,'UPDATE_ROLE_ATTRIBUTE'), (360449,'UPDATE_USER'), (360449,'UPDATE_USER_ATTRIBUTE');
Follow this documentation to Restore Passwords To Recover Admin User Rightsto recreate the administrator user.
Was this helpful?