问题
We've just migrated our TFS 2013.3 server to a new domain.
It all appeared to go to plan - I migrated the server and then migrated the Identities successfully, but instead of changing user identities to their new domain accounts, it has just added new accounts so now everybody is in the system twice.
In general I've been able to mitigate the symptoms of this, but it has broken user capacities in Web Access - each user's name appears twice, and their capacity graph only shows correctly if both names have the same capacity value assigned to them. One user does not get a capacity graph at all even if we attempt this awful workaround.
I could easily delete the old users from [Tfs_Configuration.dbo.tbl_Identity] and/or [tbl_TeamConfigurationCapacity] but I have no idea if this would be a safe thing to do, or what references to these entries might exist elsewhere in the database. (There shouldn't be any information linked to these users any more, as they have all been migrated, but that won't help me if deleting these rows corrupts the database). I may just have to snapshot the VM and give it a try to see what happens, as this is a complete showstopper.
Any help would be very much appreciated.
回答1:
I think I may have got around the problem. In case it helps the next guy, ...
The Identities table records all known users (on the old and new domain). This means people appear twice in places like "Assigned to" on work items (and if their display names are the same, it's hard to differentiate the old and new domain usernames). However, if you set up your TFS groups so that only your new domain users are in them, then you can edit the work item type Templates for your work items and set the Allowed Values rule on the Assigned-To field to only allow people in the groups (e.g.
[global]\Team Foundation Server Users), then only the currently valid usernames appear in the Assigned-to drop-downs.The problem in the capacities page is because each iteration stores a list of the relevant users at the time it was created. So after a few iterations (when you reach the next one that has not yet been "used"), the old entries will disappear. In the intervening iterations you seem to have to enter the capacity value twice (on both instances of the user's name) but make sure that any holiday bookings are only assigned to one of the two instances, and then the capacity graphs seem to work ok.
So it looks like filtering out the unwanted users and then just waiting for a couple of iterations will be enough to clean away the problems. It'd still be nice to know if there is any way to ever clean up the database and flush out all the unwanted user references though.
回答2:
The names are added twice probably because the old identity is (in)directly still a member of the contributor group. Removing the old identity from all the TFS groups in Web Access should solve the problem.
来源:https://stackoverflow.com/questions/25449926/tfs-delete-duplicated-users-after-domain-change