task #6003
closedCleanup redmine users
100%
Description
- find users which are associated with tickets as onwer, assignee, etc
select distinct u.* from issues i join users u on ( i.author_id = u.id or i.assigned_to_id = u.id) order by u.login
users which are only in thecc
field of the issues can be ignored all other users can be deleted
Maybe there is a plugin for redmine which lists all issues and wiki pages for a given user?
Updated by Andreas Müller almost 7 years ago
- Description updated (diff)
I tested and updated all existing users with the following queries. Delete duplicates and set inactive users to locked. Remaining 40 active users and 36 locked users.
SET @userId := 87;
Select i.author_id, u.login from issues i join users u on ( i.author_id = u.id ) WHERE author_id = @userId ORDER BY u.login
;
Select i.assigned_to_id, u.login from issues i join users u on ( i.assigned_to_id = u.id) WHERE assigned_to_id = @userId ORDER BY u.login
;
SELECT * From changesets cs WHERE user_id = @userId ORDER BY user_id , committer ;
SELECT * FROM journals WHERE user_id = @userId ORDER BY user_id
;
SELECT user_id, count(*) FROM members WHERE user_id = @userId GROUP BY user_id ORDER BY user_id
;
SELECT user_id, count(*) FROM members m INNER JOIN member_roles r ON r.member_id = m.id WHERE user_id = @userId GROUP BY user_id ORDER BY user_id
;
SELECT user_id user_preferences, count(*) FROM user_preferences WHERE user_id = @userId GROUP BY user_id ORDER BY user_id
;
SELECT * FROM watchers WHERE user_id = @userId ORDER BY user_id
;
SELECT * FROM wiki_contents WHERE author_id = @userId ORDER BY author_id
;
SELECT * FROM wiki_content_versions WHERE author_id = @userId ORDER BY author_id
Updated by Andreas Müller almost 7 years ago
- Status changed from New to Resolved
Open issues:
Are the following users required?
- trac (id = 10; author of 114 wiki_contents and wiki_content_versions); do we still need this wiki content? Probably it is Trac specific and not needed in Redmine
- somebody (id = 22; not an owner of any content)
- conversion (id = 125; not an owner of any content)
- anonymous (id = 135; author of 4 wiki_content_versions; but maybe used elsewhere internally?)
For the following locked users there is no known email address available: Magdy Zytomska, Veronika Kiss. Should we keep the foo.bar Email Adress
Maybe we should set Email notification for all locked users to "No events". I have done this for many already but maybe not for all
Updated by Andreas Kohlbecker almost 7 years ago
Andreas Müller wrote:
Open issues:
- Are the following users required?
- trac (id = 10; author of 114 wiki_contents and wiki_content_versions); do we still need this wiki content? Probably it is Trac specific and not needed in Redmine
The 114 Wiki pages actually are the Milestone descriptions. The user trac could be deleted if we associate this content to an other user.
- somebody (id = 22; not an owner of any content)
I vote for deleting this user
- conversion (id = 125; not an owner of any content)
I vote for deleting this user
- anonymous (id = 135; author of 4 wiki_content_versions; but maybe used elsewhere internally?)
These are the versions 2-5 of the WikiStart page, so this user can be deleted
- For the following locked users there is no known email address available: Magdy Zytomska, Veronika Kiss. Should we keep the foo.bar Email Adress
These persons seems to be completely unknown, delete them.
- Maybe we should set Email notification for all locked users to "No events". I have done this for many already but maybe not for all
Good idea! Maybe this can be easily be done in the db directly.
Updated by Andreas Kohlbecker almost 7 years ago
Andreas Kohlbecker wrote:
- Maybe we should set Email notification for all locked users to "No events". I have done this for many already but maybe not for all
Good idea! Maybe this can be easily be done in the db directly.
Done with
update users u set mail_notification = 'none' where status = 3 and mail_notification <> 'none'
Updated by Andreas Kohlbecker over 6 years ago
- Status changed from Resolved to Closed
- Assignee changed from Andreas Kohlbecker to Andreas Müller
- % Done changed from 90 to 100