Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

delete all conflunce users all at once

James Lim-It July 31, 2013

Hi,

Is there a way to delete all the users in confluence. we have about 500 users and its not gonna be a walk in the park to delete all these.

I do have an access in the database using TOAD.

Thank you,

James

4 answers

1 accepted

1 vote
Answer accepted
Septa Cahyadiputra
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2013

Hi James,

As mentioned by Peter, it is not possible for you to delete all of your users at once, even when you have database access as it tied to Confluence contents. Another possibility is to deactivate users which is possible using the following query:

UPDATE cwd_user SET Active = 'F';

Please make sure that you understand the concecuences of this action as it will set all users to inactive. If you wish to activate your admin, please refer to our documentation here.

Hope it helps.

Cheers,
Septa Cahyadiputra

1 vote
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2013

You might not want to delete all users but rather deactivate them. Deleting a user is only possible if you also delete al his or her content.

Why exactly do you want to delete all users?

Best regards,

Peter

0 votes
James Lim-It August 1, 2013

Hi all, Thanks for your comments. I tried the following:

DELETE FROM cwd_membership WHERE child_user_id != user;

DELETE FROM cwd_user_attribute WHERE user_id != user;

DELETE FROM cwd_user WHERE id != user;

it deleted the user in the tables but when i check the user in confluence, it still is there. so i tried restarting the app server and deleting the user manually through administer user page, it just kept loading and loading. same thing happens when i create a user. it seems like i am now not able to create user and remove a user. any suggestion? thanks

James Lim-It August 1, 2013

ok i managed to fixed this by restoring the site. I think I will just manually remove users from the admin page just to be safe

0 votes
fsim
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2013

Hey James.

You can do so by running these 1 by 1 (Take a DB BACKUP FIRST!):

DELETE FROM cwd_membership;
DELETE FROM cwd_user_attribute;
DELETE FROM cwd_user;

Note that this will remove All Users and only works with Confluence 3.5 and above. It will be great to limit the query with a WHERE clause, to prevent yourself from being locked out of Confluence. The best way would be to run this query:

select u.id, u.user_name, u.active from cwd_user u
join cwd_membership m on u.id=m.child_user_id join cwd_group g on m.parent_id=g.id join cwd_directory d on d.id=g.directory_id
where g.group_name = 'confluence-administrators' and d.directory_name='Confluence Internal Directory';

To identify the administrative user's id, then run the queries this way (example if the id is 2818050):

DELETE FROM cwd_membership WHERE child_user_id != 2818050;
DELETE FROM cwd_user_attribute WHERE user_id != 2818050;
DELETE FROM cwd_user WHERE id != 2818050;

Again, this is not recommended by Atlassian. So keep this KB in mind in case you get locked out: https://confluence.atlassian.com/display/DOC/Restoring+Passwords+To+Recover+Admin+User+Rights

Foogie

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events