Accounts in Work Items after migration to TFS 2010 and to new domain

Posted by Clara Oscura on Geeks with Blogs See other posts from Geeks with Blogs or by Clara Oscura
Published on Wed, 09 Jun 2010 11:58:51 GMT Indexed on 2010/06/09 12:02 UTC
Read the original article Hit count: 323

Filed under:

 

Lately I’ve been doing some tests on migrating our TFS 2008 installation to TFS 2010, coupled with a machine and domain change. One particular topic that was tricky is user accounts.

We installed first a new machine with TFS 2010 and then migrated the projects in the old server. The work items were migrated with the projects. Great, but if I try to edit one of the old work items I cannot save it anymore because some fields contain old user names (ex. OLDDOMAIN\user) which are not known in the new domain (it should be NEWDOMAIN\user).

The errors look like this:

AssignedToError

When I correct the ‘Assigned To’ field value, I get another error regarding another field:

ActivatedByError

Before TFS 2010, we had TFSUsers power tool. It allow you to map an old user name to a new user name. This is not available anymore because WI fields with user accounts are now synchronized with AD display names changes (explained here).

The correct way to go about this in TFS 2010 is to use TFSConfig Identities before adding the new domain accounts into the TFS groups (documented here). So, too late for us.

I’ve found a (tedious) workaround to change those old account in work items in order to allow people to keep working with them.

1. Install TFS 2010 power tools

2. Export WIT from your project (VS | Tools | Process Editor | Work Item Types). Save the definition, for example: Original_MyProject_Task.xml

3. Copy the xml (NoReadOnly_MyProject_Task.xml) and edit it. From the field definition of ‘Activated By’, ‘Closed By’ and ‘Resolved By’, remove the following:

       <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>

4. Import WIT in VS. Choose the new file (NoReadOnly_MyProject_Task.xml) and import it in MyProject

5. Open all tasks in Excel (flat list). Display the following columns:

  • Asssigned To
  • Activated By
  • Closed By
  • Resolved By

Change the user accounts to the new ones (I usually sort each column alphabetically to make it easier).

6. Publish.

If you get a conflict on a field, tough luck. You will have to manually choose “Local version” for each work item. I told you it was a tedious process.

7. Import original WIT (Original_MyProject_Task.xml) in MyProject. We only changed the WI definition so that we could change some fields. The original definition should be put back.

And what about these other fields?

  • Created By
  • Authorized As

These fields are not editable by definition (VS | Tools | Process Editor | Work Item Fields Explorer), even if they are not marked as read-only in the WIT. You can leave the old values. It doesn’t seem to matter to TFS.

The other four fields are editable by definition, so only the WIT readonly rule prevents us from changing them.

widefiniton

© Geeks with Blogs or respective owner