TFS Integration Tools – How can I validate that a migration or sync is working? Q&A-34
I recently noticed a question on our support alias that is ... or at least should be … a common question for those using the tools. Thanks Bill Barnett, for supplying the answer to the question and for most of the content below.
Find the latest released bits here: Team Foundation Server Integration Tools (August 2010 Release) and the latest development bits here: http://tfsintegration.codeplex.com/.
Is there any way we compare the Source TFS Team Project and migrated TFS Team projects.
There are many ways of comparing the source against the target, however, the recommended options include the use of a tool or the use of a service, both of which are included in the TFS Integration Tools.
Tool –> ServerDiff
The command line ServerDiff.exe allows you to perform a comparison of either the Version Control (VC) or Work Item Tracking (WIT) items that were processed in a migration or synchronization session.
Type Type “serverdiff.exe /?” on the command line, in the TFS Integration Tools install directory,to see a list of the runtime parameters.
- Useful after completing a one-time migration, as it is possible to specify a VC or WIT session to use as the baseline for the comparison (diff).
- The ServerDiff command line utility outputs to the console output. We suggest that you redirect the output to a file, which will be easier to consume and analyze.
Service –> TFS Integration Service
Another option is to install and configure the “TFS Integration Service”, which is not installed by the default installation.
The “TFS Integration Service” option installs a service named “TFS Integration Job Service”, which you can configure to run either or both of the VC or WIT comparison (Diff) jobs nightly.
- The WIT diff comparison takes into account all work item type, field, and value mappings defined for the Work Item migration session when performing the diff so that Work Items are not reported as different simply because of an expected mapping.
- The Job Service processes all of the Active sessions found in the database, and ignores those sessions that have completed. That is the main reason that the ServerDiff utility is the recommended tool when doing a one-time migration, whereas the service is recommended when doing continuous synchronization.
- Unlike the ServerDiff tool, the service jobs store their results in the TFS_IntegrationPlatform database and tables SERVER_DIFF_RESULT and SERVER_DIFF_RESULT_DETAIL.
But where is the report?
We do not currently have a report that works on the ServerDiff results in the DB yet, but will be releasing one shortly. Keep an eye on this post for news on this elusive report :)
In the meantime you can run the following SQL Query:
1: SELECT TOP 1 2: DR.DiffType as 'Diff Operation for Session Type' 3: ,S.FriendlyName as 'Session Name' 4: ,DR.DiffTime as 'Diff Start Time' 5: ,DR.DurationOfDiff as 'Duration in seconds' 6: ,CASE DR.AllContentsMatch 7: WHEN 0 THEN 'Differences Found' 8: WHEN 1 THEN 'Contents Match' 9: END as 'Result' 10: FROM [Tfs_IntegrationPlatform].[dbo].[SERVER_DIFF_RESULT] as DR 11: INNER JOIN [Tfs_IntegrationPlatform].[dbo].[SESSION_CONFIGURATIONS] as S ON S.SessionUniqueId = DR.SessionUniqueId 12: WHERE DiffType = 'VersionControl' 13: ORDER BY DR.Id DESC 14: GO 15: 16: SELECT DETAIL.DiffDescription as 'Differences' 17: FROM [Tfs_IntegrationPlatform].[dbo].[SERVER_DIFF_RESULT_DETAIL] as DETAIL 18: WHERE DETAIL.ServerDiffResultId = 19: (SELECT TOP 1 Id FROM [Tfs_IntegrationPlatform].[dbo].[SERVER_DIFF_RESULT] 20: WHERE DiffType = 'VersionControl' 21: ORDER BY Id DESC) 22: GO
… which gives you this result:
Use the right tool … l oaned from our book “Software Engineers on their way to Pluto”.
To configure the ServerDiff Jobs to run in the Job Service, you need to edit the file TfsIntegrationJobService.config and restart the “TFS Integration Job Service”. Both of these jobs are disabled by default as shown:
The VC Server Diff operation (whether running from the command line or the job in the job service) performs the diff operation on the tip (the latest version) of all files found in the filter pairs for the migration session. This may introduce false warnings when data has changed on the one side, but not yet migrated to the other side.