Confluence - Migrate the LDAP directory (connector) to another LDAP directory (delegated)
Asked by Naveen:

I asked for this question and didn't had any straight forward answer on how to migrate to Delegated LDAP config from Connector LDAP config, so after little bit research i could able to achieve it by following below steps and it worked for me, posting here so it might be helpful for others...

Here are the steps for migrating from Connector LDAP Configuration to Delegated LDAP configuration

<br />

1. Login to the application, from Confluence administration menu click on user management, and on user directories.

Add the new LDAP directory configuration (Delegated LDAP with Generic Server)

Note: Once the new LDAP directory is configured using internal account don't login with LDAP account before updating database which will create duplicate account and that will be additional work to delete those duplicates.

2. Make a note of the directory_id for old Connector LDAP and Newly added delegated LDAP

Connector-LDAP_ID: \*\*\*\*\*connector  
Delegated-LDAP_ID: \*\*\*\*\*delegated

3. Below are the tables that need to be updated with new directory_id

cwd_group  
cwd_user  
cwd_user_attribute

How did I determine this, by running below command

SELECT DISTINCT TABLE_NAME  
FROM INFORMATION_SCHEMA.COLUMNS  
WHERE COLUMN_NAME IN ('directory_id')  
AND TABLE_SCHEMA='confluence';

I figured out above mentioned three tables are the one's which needs to be updated after cross checking and investigating columns from given tables by above command

<br />

4. Below are the update commands we need to run for above mentioned tables, there is no order required for running these update commands.

update cwd_user set directory_id=Connector-LDAP_ID where directory_id=Delegated-LDAP_ID;

update cwd_user_attribute set directory_id=Connector-LDAP_ID where directory_id=Delegated-LDAP_ID;

update cwd_group set directory_id=Connector-LDAP_ID where directory_id=Delegated-LDAP_ID;

Note1: Application needs to be turned off before running these update commands.  
Note2: Please replace Connector-LDAP_ID and Delegated-LDAP_ID with actual directories (You can get those id values by running select \* from cwd_directory;

5. Do content indexing after following above steps.

Note: Please take a back up of your database before updating the tables or try it out in test instance to make sure it works for you.

This is just some information i am posting here and these steps are not validated by atlassian.


Answers:
author: Inayat Nahvi
body: Found an article which directly addresses migrating from Connector to Delegated LDAP - [https://confluence.atlassian.com/kb/how-to-migrate-from-a-connector-type-user-directory-to-delegated-969513390.html.](https://confluence.atlassian.com/kb/how-to-migrate-from-a-connector-type-user-directory-to-delegated-969513390.html)

I think this should work for any Atlassian tool.


author: Daniel Eads
body: Hi Naveen,

Glad you were able to get your directories migrated the way you needed! We do have some [established practices and documentation available](https://confluence.atlassian.com/adminjiraserver/migrating-users-between-user-directories-938847059.html) if you find you need to do this in the future and run into any issues.

Cheers,  
Daniel