How to recreate the Confluence Internal User Directories

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Purpose

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 performing any modifications to the database. 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:

  1. Remember to backup your Confluence database dump before running any of the queries below.
  2. Shutdown Confluence.
  3. Run these queries to recreate the directory:

    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');
     
  4. Follow this documentation to Restore Passwords To Recover Admin User Right to recreate the administrator user.


Last modified on Mar 9, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.