How to merge users in Confluence?

Last night some users were re-named in AD so now the user has two accounts within the user directory (Microsoft AD read only, with Local Groups) in Confluence 4.3.5. Is there a way to merge the old account with the new account? For example, bphillips was renamed to brucephillips in AD. Now, both accounts exist in Confluence's user directory. I would like all the old content associated with the bphillips user to be associated with brucephillips.

5 answers

1 accepted

1 vote
Answer accepted

Take a look at this plugin:

It is fantastic for Jira, I haven't used it for Confluence before. The rename a user functionality has the option to merge them into another.

Gonchik Tsymzhitov Community Champion Sep 18, 2014

I tried but is not work on the Confluence 5.4.3

The following is a re-name and migrate method we use for Confluence and JIRA:

Let's say you have a user with the username 'alice' in your local directory. Now you add an LDAP which contains a NEW user 'bob' and you want to migrate alice to bob. Follow these steps:

1. Make sure your local directory has priority over the LDAP. (local dir is positioned above the LDAP in the 'User Directories' admin screen)

2. rename 'alice' to 'bob'

3. Move LDAP to have priority over your local directory.

Result: The new 'bob' has taken over all the content of the user previously known as 'alice'.


This method has been tested when migrating from Local to AD and from AD to another AD.

Warning: This only works when migrating content to a new user. So far I have not yet been able to merge two existing (active) users with this method. I tested this and it results in the content of the 'lower priority'-user to be of 'Unknown User'.

By far the best answer here!

Used this exact method to merge users from remote LDAP to Crowd.

1. Users were in Confluence via LDAP Directory

2. Added User with same username in Crowd

3. Connected Crowd with Confluence

4. Set LDAP Directory as first prio

5. Synchronized Crowd Users

6. Tested Crowd User Login (dry-run in "User Directories")

7. Moved Crowd to first prio

8. Disabled LDAP

9. Changed Username in Crowd to E-Mail (since we wanted email to be login from now on)

10. Synchronized Crowd Directory again

9. Dance in Joy, as everything the LDAP user edited is now shown to be edited by the Crowd User!

I used the SQL commands here to migrate a users activity and content to another user:

Cool, thanks! I had a hard time figuring out where the username was used to register activity. This cleared things up. :)

Hello Tobias, Thank you for the link! This would be useful. Did you get some feedbacks about those queries? On which version did you try them? Regards, Nicolas.

I ran these on a production Confluence instance running 5.8.4

Thank you for your answer.

Hello Tobias, In order to avoid some duplicates in the database (and in the user management administration in Confluence), here are some additional queries: delete from cwd_user_attribute where user_id='28311553'; delete from cwd_membership where child_user_id='28311553'; delete from cwd_user where id ='28311553'; Where "28311553" is the ID of the "old" user in the database. Then, this query (provided by Atlassian in this ticket helped me to clean everything that needed to be cleaned : DELETE FROM CONTENT WHERE contentid IN (select * from (SELECT DISTINCT c1.contentid FROM CONTENT c1 JOIN CONTENT c2 ON c1.username = c2.username WHERE c1.contenttype = 'USERINFO' AND c2.contenttype = 'USERINFO' AND c1.prevver is null AND c2.prevver is null AND c1.contentid > c2.contentid) as tmp); Note: For MySQL. Nicolas.

0 votes
Davin Studer Community Champion Oct 03, 2013

5.3 added the ability to change a user's username, but merging after the fact ... dunno.

Gonchik Tsymzhitov Community Champion Sep 18, 2014

Did you resolved this issue?

Gonchik Tsymzhitov Community Champion Dec 18, 2014


And now with recent upgrades, the script runner plugin no longer has merge capabilities.  How can we merge user names?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,161 views 2 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you