The scenario starts with a team project, for example TP-A1, on a TFS Server, which has version control (VC), work item tracking (WIT) data and links between the two. A decision is then made to migrate only the VC data from TFS Server A to TFS Server B, using the TFS Integration Tools (Platform), performing ad-hoc update migrations from Server A to Server B.
Adam C. then queries “Is there anyway going forward for us to migrate WIs to the same team project where we previously migrated source and keep the relationships between WIs, change sets and source? ”.
In essence we would like to continue running the ad-hoc update migrations from Server A to Server B, but migrate VC, WIT and their links going forward as shown below.
Bill E. replies “A session group consists of multiple sessions. When VC and WIT sessions are run in the same session group they share access to conversion history that lets linking resolve references on the target system. We do not have a feature in place that lets a user start a separate session group and tell the tool that it intentionally wants this conversion history context to be available within a separate session group. Generally that means that the user needs to plan ahead if they want to preserve links between WIs and VC content and run them in the same session group.”
The following journal documents a test to validate a possible work around, which involves XML editing (yuck) and is not a recommended scenario. Instead plan ahead and decide if VC, WIT and links should be preserved, migrating/synchronizing all the relevant data from the start.
Setting up a VM with a test environment
- I used the Visual Studio Virtual Machine (VM) Factory to create a Rangers base image, running a single server TFS_ATDT and Visual Studio Ultimate environment.
- I copied the TFS Integration Tools (Platform) HOL package and configured the environment running the HOLSetup and the SetupAdmin scripts as per readme files. This created us the following test team project with VC and WIT data, but no links as yet.
- We are making a few assumptions, namely that (1) the simple HOL data is sufficient and that (2) the Standalone Server simulates two separate TFS Servers A and B.
Doing a simple VC Migration
- Using the TFS Integration Admin shell and the default VersionControl template delivered with the product, we create a VC-only migration session group as shown:
- We perform a migration, which moves the VC data from team project TP-A to team project TP-B. We have to resolve three VC conflicts, which involve a confusing dialog … see Where does one start? … part 3 (dust has settled …. did it work?) for more information.
- We then resolve the WI:1 bug in TP-A, check-in the code changes, linking to the relevant WIT bug.
- This creates the following environment, which is the starting point on Server A as defined by the scenario above.
- We run another update migration using the same session and are left with the environment as documented at the start of the scenario, with migrated VC data, but no WIT or VC-WIT relationships in the team project on Server B.
- Validation steps:
- Review source code in TP-A … code fix is included.
- Review work items in TP-A … bug 1 is resolved and there is a relationship between the WI #1 and the VC Changeset #43.
- Review source code in TP-B … code fix is included.
- Review work items in TP-B … as expected we have no work items.
Up to this point we merely created the scenario environment. Now let us do some work-around magic
Doing a simple WIT Migration afterwards and maintaining relationships between VC and WIT
So, how can we get the WIT data included in the upgrade migration session we created for VC and also maintain the link relationships?
- Using the TFS Integration Admin shell and the default WorkItemTracking template delivered with the product, we create a WIT-only migration session group as shown:
DO NOT RUN THIS SESSION! For safety I actually never saved my session to the database, which kept the Start button disabled.
- (1) Select the CML tab, (2) make a copy of the configuration XML from the WIT-only migration session group once you are happy with the configuration. I (3) copied mine into XML and made a safety save to c:\temp … just in case.
- Re-open existing VC-only session group, edit current, switch to XML and carefully merge content into Providers, MigrationSources and Sessions. Save changes to database and note that we now have a WIT and a VC session in the same group. The former is “Not yet migrated”.
- Here is a complete copy of the configuration XML:
- Run the session group again.
- We notice that we now have VC and WIT migrated data.
- Validation steps:
- Review source code in TP-B … code fix is included. Unchanged.
- Review work items in TP-B … “Cowabunga” we now have (1) a resolved bug 2 is resolved and there is (2) a relationship between the WI #2 and the VC Changeset #44 on TP-B. Peeking (3) into the changeset, we even notice the origin of the changeset, namely #43 from TP-A, tied to TP-A Bug WI#1.
Migrating VC/WIT changes thereafter
- Just for good measure we make another change in TP-A by adding another bug, making another code change and tying up the new changeset and the resolved bug.
- Re-run the session group.
- We can now validate and verify that on-going changes in TP-A VC and WIT data, as well as link relationships between VC and WIT will move from TP-A to TP-B as the migration session group is run periodically.
This post documents a “possible workaround” for this scenario. It is not available or supported out-of-the-box and it is important that you validate this workaround in your test environment before trying it on your production data.