"The Rename Problem"

Published 27 September 07 06:46 PM | mmitrik 

One of the migration tools that has been around as long as TFS is the VSSConverter utility.  Some time after the release, when TFS adoption started to grow, and VSSConverter usage started to grow, a strange issue began to be reported by customers: some versions of their files were empty or missing after migration. 

After extensively researching the issue, we noticed some common patterns - files with missing versions typically were either renamed, moved, or were under a parent folder that was renamed or moved.  Basically, if the namespace of a file changed at some point in time, some versions were not being migrated correctly.  This issue became affectionately known as "The Rename Problem".

This problem is known to exist in both the Whidbey and Orcas versions of the VSSConverter.  In both releases, only the historical versions of files are affected - the latest version in TFS will match the latest version in VSS. 

To get some context into the what is happening, and what the workaround is, keep reading.  Fixing this issue altogether is something we're planning for a post-Orcas release, but until then, the following workaround should be useful to many users.


Events such as renames, archive and restore, sharing, branching, and move can create namespace conflicts in the history of VSS.  What is a namespace conflict?  Imagine there is a file foo.cs under a folder Bar.  At some point, Bar is renamed to Baz, so the namespace of foo.cs is "Baz/foo.cs".  Later, another folder named Bar is added to VSS, and under it resides a file named foo.cs.  This new foo.cs has a namespace of "Bar/foo.cs", which used to be the namespace of the original foo.cs.  We would say that these files have a namespace conflict, because at they shared the same namespace, albeit at different points in time. 

These namespace conflicts result in files and folders not being migrated correctly by the VSSConverter.  This problem can be identified if there are missing versions of converted files, or missing files from the conversion.  In the log file and/or migration report, you will see the following errors: 

"The item already exists."

OR

"The item could not be found in workspace." 

In some cases, changing the mappings in the configuration file can help to migrate files correctly.  If the missing versions are located under a folder named "ProjA", the mappings can be changed to a subfolder of "ProjA".  For example, the mappings:

<ProjectMap>
<Project Source="$/Projects/ProjA" Destination="$/TFSProjects/ProjA" />
</ProjectMap>

Can be changed to:

<ProjectMap>
<Project Source="$/Projects/ProjA/SubFolder1" Destination="$/TFSProjects/ProjA/SubFolder1" />
<Project Source="$/Projects/ProjA/SubFolder2" Destination="$/TFSProjects/ProjA/SubFolder2" />
<Project Source="$/Projects/ProjA/SubFolder3" Destination="$/TFSProjects/ProjA/SubFolder3" />
</ProjectMap>

Once these mappings are changed in the config file, the VSSConverter can be run again.  If some of the files are still not migrated correctly, the mappings may be further scoped to another subfolder.

Comments

No Comments
Anonymous comments are disabled
Page view tracker