31 May 2009 @ 5:12 PM 
 

Migrating Visual SourceSafe to Subversion

 

I’ve been using Subversion(SVN) at work for any new projects that I start.  The rest of my applications are all stored in Visual SourceSafe(VSS).  I recently had to start adding some functionality to a couple of the VSS stored projects but I really wanted them to get migrated to subversion.  So after doing some non-stack overflow searches (the stack overflow searches were very very pessimistic and “i give up”ish, I found a utility to do it for me… I found it at http://www.poweradmin.com/sourcecode/vssmigrate.aspx.  (Note: The following is not an official historical record, merely a rough summarization). Quite a few people have added to this utility over the past year including: Jim Watters, Ricardo Stuven, Matt Palmerlee, Karl Zeift.  And then Tim Erickson ported it to C# with his additions.  Erik Lane worked on it and Erik and Tim put it on CodePlex where i96danma and jim0301 committed updates to it.  Ok with the history out of the way, this tool is everything you probably need to migrate a VSS repository to SVN.  

Before May 23, VssMigrate would re-create the check in history from VSS into SVN.  But because of the way VSS works, which is one file per commit, the final SVN repository ended up not quite a perfect representation of the commit history.  You might have committed 10 files in one batch, but VSS checks them in one at a time.  In SVN we want that whole batch of 10 files to show as 1 commit and therefore rev up the repository only once.  jim0301 updated VssMigrate to handle this situation perfectly.  So now you can fully migrate with a very nice history.  Even nicer than VSS held natively.  Thank you jim0301.

Another nice thing about VssMigrate is it will remove all of the VSS bindings (all the hidden files for vss) and only migrate the real sources for your app.

I am going to go out on a limb and “assume” you are a developer and comfortable with source code.  I can’t quite put my finger on any particular reasons why but I think it a safe assumption here.  So go grab the latest source code from the trunk here. Click download on change set 16890 or above (16890 is the tip at the time of this post). or you could use the following command from a command prompt (with svn in your path):

svn co https://vssmigrate.svn.codeplex.com/svn/trunk vssmigrate

When you load the solution you will probably get a warning:

The referenced component ‘log4net’ could not be found.

Warning 5 Resolved file has a bad image, no metadata, or is otherwise inaccessible. “Could not load file or assembly ‘Path\lib\log4net\log4net.dll’ or one of its dependencies. The module was expected to contain an assembly manifest.

You can replace this one with a version from it’s home or direct link.  Just overwrite the log4net.dll in /vssmigrate/src/lib/log4net/

To save you the trouble I have a copy of the source code with the re-referenced log4net file.

If you are on a 64-bit machine.  Make sure to change the build configuration to x86 because there is no 64 bit library for the Visual Source Safe Interop and when you execute your app it will throw an exception that’s quite cryptic. To do this in Visual Studio do: Build –> Configuration Manager… –> Active Solution Platform = x86.  Or on the Standard Toolbar change the “Any CPU” drop down list box to “x86”.

Now that you have it compiled we’ll start the walkthrough:

 

Step 1: Edit The Application Configuration

 

This should be broken up into two edits, pre-compile and post-compile.  Edit the app.config in the solution pre-compile, and the  VssMigrate.exe.config post-compile in the /bin directory for each migration.  I would suggest setting the settings that won’t change i.e. user names and passwords and repository locations in the app.config so you don’t have to change them in the exe.config after every recompile. 

VssMigrate.exe.config

   1: <?xml version="1.0" encoding="utf-8"?>

   2: <configuration>

   3:   <appSettings>

   4:     <!-- # VSS\\Win32 directory which contains ssapi.dll-->

   5:     <add key="VSSWIN32" value="C:\Program Files\Microsoft Visual Studio\VSS\win32\" />

   6:     <!-- #VSS repository directory (contains srcsafe.ini)-->

   7:     <add key="VSSDIR" value="\\server\path\" />

   8:     <!-- #VSS project to start at (ie $/Product)-->

   9:     <add key="VSSPROJ" value="$/Products/Gadget" />

  10:     <!-- #User to use for VSS commands, use blank for none-->

  11:     <add key="VSSUSER" value="vssuser" />

  12:     <!-- #password to use for VSS commands, blank is OK-->

  13:     <add key="VSSPASSWORD" value="" />

  14:     <!-- #User to use for SVN commands, use blank for none-->

  15:     <add key="SVNUSER" value="svnuser" />

  16:     <!-- #password to use for SVN commands, blank is OK-->

  17:     <add key="SVNPASSWORD" value="svnpw" />

  18:     <!-- #URL to use for the root of the check in-->

  19:     <add key="SVNURL" value="http://server:3690/svn/" />

  20:     <!-- #SVN project to start at (ie Product)-->

  21:     <add key="SVNPROJ" value="Products/Gadget/trunk" />

  22:     <!-- #SVN Repository directory (ends in [RepositoryName]\db\revprops\)leave blank for no user/date adjustments -->

  23:     <add key="SVNREVPROPSPATH" value="\\server\SVNRepos\Products\db\revprops" />

  24:     <!-- #Directory under which files and directories will be created as work progresses-->

  25:     <add key="WORKDIR" value="c:\Temp\VssMigrate" />

  26:  

  27:       <!-- Boolean setting for determining whether or not to actually perform the import

  28:             When set to false, the program will only show what files and/or revisions will be generated

  29:             When set to true, the program will perform the migration

  30:       -->

  31:       <add key="PerformImport" value="False" />

  32:  

  33:       <!-- Boolean setting for determining whether to go file-by-file and version-by-version or to discover

  34:             the revisions from the check-in history based on the dates, authors and comments as a key.

  35:         -->

  36:       <add key="DiscoverRevisions" value="True" />

  37:       

  38:       <!--

  39:         The window of time (in seconds) for multiple check-ins that may be considered a single revision

  40:         The key for the merge / revision is the "time,author,comment."  Once all keys have been identified

  41:         the merge will move all files from a later revision into an earlier revision thereby

  42:         changing the time to the earlier revision.  This happens iteratively.

  43:         

  44:         Ignored if DiscoverRevisions is false

  45:         

  46:         Additional notes:

  47:         End of lines and tabs are removed from comments and they are trimmed to determine the keys for merging / revisions

  48:       -->

  49:       <add key="MergeRevisionWindow" value="120" />

  50:  

  51:       <!--

  52:             Full Spec is passed into the regex's 

  53:             e.g. inclusion => (\$/$)|(\$/Sub1(/Sub1A(/Sub1A2(/Sub1A2a)?)?)?$)|(\$/Sub1/Sub1A/Sub1A2/Sub1A2a.*)

  54:             Only one or none of the exclusion/inclusion regex pairs may be set

  55:             The regex's are case-insensitive

  56:             Reminder: escape the $/ to \$/

  57:         -->

  58:       <add key="VssFolderExclusionRegex" value=""/>

  59:       <add key="VssFolderInclusionRegex" value="" />

  60:  

  61:       <!-- e.g. inclusion => (\$/Sub1/Sub1A/Sub1A2/Sub1A2a.*) -->

  62:       <add key="VssFileExclusionRegex" value=""/>

  63:       <add key="VssFileInclusionRegex" value=""/>

  64:   </appSettings>

  65: </configuration>

—–

Here are the lines that will should be changed Pre-Compile.

Line 5:  Local VSS Client Install Directory

   4: <!-- # VSS\\Win32 directory which contains ssapi.dll-->

   5: <add key="VSSWIN32" value="C:\Program Files\Microsoft Visual Studio\VSS\win32\" />

This needs to be set to the local install of the VSS client.  Look for your ssapi.dll file.

Line 7: VSS Repository Location

   6: <!-- #VSS repository directory (contains srcsafe.ini)-->

   7: <add key="VSSDIR" value="\\server\path\" />

Set the value equal to your VSS repositories where the srcsafe.ini file is.

Lines 11 and 13: VSS User and Password

   10: <!-- #User to use for VSS commands, use blank for none-->

   11: <add key="VSSUSER" value="vssuser" />

   12: <!-- #password to use for VSS commands, blank is OK-->

   13: <add key="VSSPASSWORD" value="Password" />

Lines 15 and 17: SVN User and Password

   14: <!-- #User to use for SVN commands, use blank for none-->

   15: <add key="SVNUSER" value="svnuser" />

   16: <!-- #password to use for SVN commands, blank is OK-->

   17: <add key="SVNPASSWORD" value="svnpw" />

Line 19:  SVN Root URL

   18: <!-- #URL to use for the root of the check in-->

   19: <add key="SVNURL" value="http://server:3690/svn/" />

Line 25: tmp folder for migration

   24: <!-- #Directory under which files and directories will be created as work progresses-->

   25: <add key="WORKDIR" value="c:\Temp\VssMigrate" />


Make sure this folder exists.

 

Those 8 settings will probably not change unless you are working with multiple subversion or vss repositories with at multiple locations and with multiple user accounts.

 

Next the following 3 settings will change per project. You will execute VssMigrate.exe for each project after making these changes.

Line 9: VSS Project Root

   8: <!-- #VSS project to start at (ie $/Product)-->

   9: <add key="VSSPROJ" value="$/Products/Gadget" />

$/ is the root for all your projects.  If you want to migrate all your projects you should do this one project at a time.  
  

Line 21: SVN Project Trunk

   20: <!-- #SVN project to start at (ie Product)-->

   21: <add key="SVNPROJ" value="Products/Gadget/trunk" />

You may not have a SVN Repository created for you project yet.  If not, go ahead and create one and then come back. If you are unsure how… maybe you shouldn’t be trying to import into SVN… but here is my walkthrough to get started.

   

Line 23: Physical location of SVN Repositories (used to update user and commit time)

   22: <!-- #SVN Repository directory (ends in [RepositoryName]\db\revprops\)leave blank for no user/date adjustments -->

   23: <add key="SVNREVPROPSPATH" value="\\server\SVNRepos\Products\db\revprops" />

Now your application configuration is all set. 

 

Step 2:  More app.config: Discover Revision “Sets” instead of single file commits.

Lines 36 and 49

  33: <!-- Boolean setting for determining whether to go file-by-file and version-by-version or to discover

  34:       the revisions from the check-in history based on the dates, authors and comments as a key.

  35:   -->

  36:    <add key="DiscoverRevisions" value="True" />

  37:    

  38:    <!--

  39:   The window of time (in seconds) for multiple check-ins that may be considered a single revision

  40:   The key for the merge / revision is the "time,author,comment."  Once all keys have been identified

  41:   the merge will move all files from a later revision into an earlier revision thereby

  42:   changing the time to the earlier revision.  This happens iteratively.

  43:   

  44:   Ignored if DiscoverRevisions is false

  45:   

  46:   Additional notes:

  47:   End of lines and tabs are removed from comments and they are trimmed to determine the keys for merging / revisions

  48:    -->

  49:    <add key="MergeRevisionWindow" value="120" />

 

You will probably want to leave DiscoverRevisions = True.  The MergeRevisionWindow is the time range that the VSS Commits will be grouped together to form 1 SVN commit.  I have found 120 seconds to be a good number.

  

Step 3: Choose a practice import, or a real import.

 

Line 31: Show What Will Be Imported? Or Actually Perform The Import?

  27: <!-- Boolean setting for determining whether or not to actually perform the import

  28: When set to false, the program will only show what files and/or revisions will be generated

  29: When set to true, the program will perform the migration

  30: -->

  31: <add key="PerformImport" value="False" />

When set to False,  a xml file will be created to show you what files will be imported.  This is especially useful if you set DiscoverRevisions = True.  This way you can verify what files will be imported with each commit. 

 

Step 4: Execute VssMigrate.exe.

 

Now to put it all together.  After you’ve edited your App.Config and/or VssMigrate.exe.config you are ready to do either a test migration or the actual thing.  If you set PerformImport=False in the config, you will get

TestRun

Step 5: Verify your revisions_merged.xml

 

the revisions_merged.xml will look similar to (this is a sample import I did):

notice how the commits are grouped by time… very nice.

   1: <revisions count="42">

   2:     <revision time="10/18/2006 4:51:46 PM" author="Kadena" comment="">

   3:         <file name="$/ProdReporting/BoxLabel1.Dsr" version="1" />

   4:         <file name="$/ProdReporting/BoxLabel1.dsx" version="1" />

   5:         <file name="$/ProdReporting/BoxLabel2.Dsr" version="1" />

   6:         <file name="$/ProdReporting/BoxLabel2.dsx" version="1" />

   7:         <file name="$/ProdReporting/BoxLabel4.Dsr" version="1" />

   8:         <file name="$/ProdReporting/BoxLabel4.dsx" version="1" />

   9:         <file name="$/ProdReporting/ProdReporting.vbp" version="1" />

  10:         <file name="$/ProdReporting/clsMastRec.cls" version="1" />

  11:         <file name="$/ProdReporting/frmAbout.frm" version="1" />

  12:         <file name="$/ProdReporting/frmAbout.frx" version="1" />

  13:         <file name="$/ProdReporting/frmAdminMain.frm" version="1" />

  14:         <file name="$/ProdReporting/frmAdminPWord.frm" version="1" />

  15:         <file name="$/ProdReporting/frmDelBox.frm" version="1" />

  16:         <file name="$/ProdReporting/frmDetail.frm" version="1" />

  17:         <file name="$/ProdReporting/frmDetail.frx" version="1" />

  18:         <file name="$/ProdReporting/frmDspPartials.frm" version="1" />

  19:         <file name="$/ProdReporting/frmDspPartials.frx" version="1" />

  20:         <file name="$/ProdReporting/frmHistory.frm" version="1" />

  21:         <file name="$/ProdReporting/frmHistory.frx" version="1" />

  22:         <file name="$/ProdReporting/frmMain.frm" version="1" />

  23:         <file name="$/ProdReporting/frmMain.frx" version="1" />

  24:         <file name="$/ProdReporting/frmMDI.frm" version="1" />Ex

  25:         <file name="$/ProdReporting/frmMDI.frx" version="1" />

  26:         <file name="$/ProdReporting/frmPartial.frm" version="1" />

  27:         <file name="$/ProdReporting/frmPartial.frx" version="1" />

  28:         <file name="$/ProdReporting/frmPrint.frm" version="1" />

  29:         <file name="$/ProdReporting/frmPrint.frx" version="1" />

  30:         <file name="$/ProdReporting/frmSetInuse.frm" version="1" />

  31:         <file name="$/ProdReporting/frmUpdateMsg.frm" version="1" />

  32:         <file name="$/ProdReporting/frmUpdateMsg.frx" version="1" />

  33:         <file name="$/ProdReporting/modUpdateDatabase.bas" version="1" />

  34:         <file name="$/ProdReporting/Partial.Dsr" version="1" />

  35:         <file name="$/ProdReporting/Partial.dsx" version="1" />

  36:         <file name="$/ProdReporting/resmod.bas" version="1" />

  37:     </revision>

  38:     <revision time="12/14/2006 10:36:22 AM" author="Kadena" comment="">

  39:         <file name="$/ProdReporting/frmHistory.frm" version="2" />

  40:     </revision>

  41:     <revision time="12/14/2006 1:05:08 PM" author="Kadena" comment="">

  42:         <file name="$/ProdReporting/frmHistory.frm" version="3" />

  43:     </revision>

  44:     <revision time="12/14/2006 3:43:20 PM" author="Kadena" comment="">

  45:         <file name="$/ProdReporting/frmHistory.frm" version="4" />

  46:     </revision>

  47:     <revision time="12/15/2006 10:06:00 AM" author="Kadena" comment="">

  48:         <file name="$/ProdReporting/frmHistory.frm" version="5" />

  49:     </revision>

  50:     <revision time="12/15/2006 10:11:16 AM" author="Kadena" comment="">

  51:         <file name="$/ProdReporting/frmHistory.frm" version="6" />

  52:     </revision>

  53:     <revision time="12/18/2006 9:39:32 AM" author="Kadena" comment="">

  54:         <file name="$/ProdReporting/frmHistory.frm" version="7" />

  55:         <file name="$/ProdReporting/frmMDI.frm" version="2" />

  56:     </revision>

  57:     <revision time="12/18/2006 10:40:04 AM" author="Kadena" comment="">

  58:         <file name="$/ProdReporting/frmHistory.frm" version="8" />

  59:     </revision>

  60:     <revision time="12/18/2006 10:49:48 AM" author="Kadena" comment="">

  61:         <file name="$/ProdReporting/frmHistory.frm" version="9" />

  62:     </revision>

  63:     <revision time="12/18/2006 10:52:30 AM" author="Kadena" comment="">

  64:         <file name="$/ProdReporting/frmHistory.frm" version="10" />

  65:     </revision>

  66:     <revision time="12/18/2006 10:54:22 AM" author="Kadena" comment="">

  67:         <file name="$/ProdReporting/frmHistory.frm" version="11" />

  68:     </revision>

  69:     <revision time="12/18/2006 11:45:46 AM" author="Kadena" comment="">

  70:         <file name="$/ProdReporting/frmHistory.frm" version="12" />

  71:     </revision>

  72:     <revision time="12/19/2006 9:17:36 AM" author="Kadena" comment="">

  73:         <file name="$/ProdReporting/frmHistory.frm" version="13" />

  74:     </revision>

  75:     <revision time="12/19/2006 9:40:28 AM" author="Kadena" comment="">

  76:         <file name="$/ProdReporting/frmHistory.frm" version="14" />

  77:         <file name="$/ProdReporting/frmMDI.frm" version="3" />

  78:     </revision>

  79:     <revision time="12/19/2006 9:56:46 AM" author="Kadena" comment="">

  80:         <file name="$/ProdReporting/frmHistory.frm" version="15" />

  81:         <file name="$/ProdReporting/frmMDI.frm" version="4" />

  82:     </revision>

  83:     <revision time="12/19/2006 10:03:42 AM" author="Kadena" comment="">

  84:         <file name="$/ProdReporting/frmHistory.frm" version="16" />

  85:         <file name="$/ProdReporting/frmMDI.frm" version="5" />

  86:     </revision>

  87:     <revision time="12/19/2006 10:05:48 AM" author="Kadena" comment="">

  88:         <file name="$/ProdReporting/frmHistory.frm" version="17" />

  89:         <file name="$/ProdReporting/frmMDI.frm" version="6" />

  90:     </revision>

  91:     <revision time="12/19/2006 10:37:26 AM" author="Kadena" comment="">

  92:         <file name="$/ProdReporting/frmHistory.frm" version="18" />

  93:     </revision>

  94:     <revision time="12/19/2006 10:40:46 AM" author="Kadena" comment="">

  95:         <file name="$/ProdReporting/frmHistory.frm" version="19" />

  96:     </revision>

  97:     <revision time="12/19/2006 12:54:58 PM" author="Kadena" comment="">

  98:         <file name="$/ProdReporting/frmHistory.frm" version="20" />

  99:         <file name="$/ProdReporting/frmMDI.frm" version="7" />

 100:     </revision>

 101:     <revision time="12/19/2006 1:07:04 PM" author="Kadena" comment="">

 102:         <file name="$/ProdReporting/frmHistory.frm" version="21" />

 103:     </revision>

 104:     <revision time="12/19/2006 3:32:44 PM" author="Kadena" comment="">

 105:         <file name="$/ProdReporting/frmDetail.frm" version="2" />

 106:     </revision>

 107:     <revision time="12/20/2006 3:26:42 PM" author="Kadena" comment="">

 108:         <file name="$/ProdReporting/frmDetail.frm" version="3" />

 109:     </revision>

 110:     <revision time="12/26/2006 2:25:14 PM" author="Kadena" comment="">

 111:         <file name="$/ProdReporting/frmHistory.frm" version="22" />

 112:         <file name="$/ProdReporting/frmMDI.frm" version="8" />

 113:         <file name="$/ProdReporting/modUpdateDatabase.bas" version="2" />

 114:     </revision>

 115:     <revision time="1/11/2007 7:55:16 AM" author="Kadena" comment="">

 116:         <file name="$/ProdReporting/frmAbout.frm" version="2" />

 117:     </revision>

 118:     <revision time="1/12/2007 9:19:36 AM" author="Kadena" comment="">

 119:         <file name="$/ProdReporting/frmMDI.frm" version="9" />

 120:     </revision>

 121:     <revision time="1/12/2007 11:33:00 AM" author="Kadena" comment="">

 122:         <file name="$/ProdReporting/modUpdateDatabase.bas" version="3" />

 123:     </revision>

 124:     <revision time="1/29/2007 1:51:22 PM" author="Kadena" comment="">

 125:         <file name="$/ProdReporting/frmHistory.frm" version="23" />

 126:         <file name="$/ProdReporting/frmMDI.frm" version="10" />

 127:     </revision>

 128:     <revision time="1/29/2007 2:01:18 PM" author="Kadena" comment="">

 129:         <file name="$/ProdReporting/frmDetail.frm" version="4" />

 130:     </revision>

 131:     <revision time="8/25/2008 2:04:24 PM" author="Nkelley" comment="">

 132:         <file name="$/ProdReporting/BoxLabel1.Dsr" version="2" />

 133:         <file name="$/ProdReporting/BoxLabel1.dsx" version="2" />

 134:         <file name="$/ProdReporting/BoxLabel2.Dsr" version="2" />

 135:         <file name="$/ProdReporting/BoxLabel2.dsx" version="2" />

 136:         <file name="$/ProdReporting/BoxLabel4.Dsr" version="2" />

 137:         <file name="$/ProdReporting/BoxLabel4.dsx" version="2" />

 138:         <file name="$/ProdReporting/ProdReporting.vbp" version="2" />

 139:     </revision>

 140:     <revision time="1/5/2009 3:54:48 PM" author="Nkelley" comment="">

 141:         <file name="$/ProdReporting/BoxLabel3.Dsr" version="1" />

 142:         <file name="$/ProdReporting/BoxLabel3.dsx" version="1" />

 143:         <file name="$/ProdReporting/BoxLabel4.Dsr" version="3" />

 144:         <file name="$/ProdReporting/BoxLabel4.dsx" version="3" />

 145:         <file name="$/ProdReporting/ProdReporting.vbp" version="3" />

 146:     </revision>

 147:     <revision time="1/5/2009 4:43:00 PM" author="Nkelley" comment="TZT Line Added">

 148:         <file name="$/ProdReporting/BoxLabel4.dsx" version="4" />

 149:         <file name="$/ProdReporting/frmDetail.frm" version="5" />

 150:         <file name="$/ProdReporting/frmMain.frm" version="2" />

 151:         <file name="$/ProdReporting/frmMDI.frm" version="11" />

 152:         <file name="$/ProdReporting/ProdReporting.vbp" version="4" />

 153:     </revision>

 154:     <revision time="1/6/2009 3:47:02 PM" author="Nkelley" comment="">

 155:         <file name="$/ProdReporting/frmMain.frm" version="3" />

 156:         <file name="$/ProdReporting/modUpdateDatabase.bas" version="4" />

 157:     </revision>

 158:     <revision time="1/6/2009 3:50:40 PM" author="Nkelley" comment="">

 159:         <file name="$/ProdReporting/BoxLabel4.Dsr" version="4" />

 160:         <file name="$/ProdReporting/BoxLabel4.dsx" version="5" />

 161:         <file name="$/ProdReporting/frmDetail.frm" version="6" />

 162:         <file name="$/ProdReporting/frmMain.frm" version="4" />

 163:         <file name="$/ProdReporting/frmMDI.frm" version="12" />

 164:         <file name="$/ProdReporting/ProdReporting.vbp" version="5" />

 165:     </revision>

 166:     <revision time="4/16/2009 11:56:16 AM" author="Nkelley" comment="Fixed boxlabel4 table issue">

 167:         <file name="$/ProdReporting/BoxLabel4.Dsr" version="5" />

 168:         <file name="$/ProdReporting/BoxLabel4.dsx" version="6" />

 169:         <file name="$/ProdReporting/ProdReporting.vbp" version="6" />

 170:     </revision>

 171:     <revision time="4/16/2009 12:03:30 PM" author="Nkelley" comment="">

 172:         <file name="$/ProdReporting/ProdReporting.vbp" version="7" />

 173:     </revision>

 174:     <revision time="4/23/2009 11:04:50 AM" author="Nkelley" comment="Fixed problem where line 4 box labels would only print what was in the line 3 mysql table">

 175:         <file name="$/ProdReporting/frmMDI.frm" version="13" />

 176:         <file name="$/ProdReporting/ProdReporting.vbp" version="8" />

 177:     </revision>

 178:     <revision time="5/4/2009 10:07:06 AM" author="Nkelley" comment="Added Control-N for Auto Add New Serial Number">

 179:         <file name="$/ProdReporting/frmDetail.frm" version="7" />

 180:         <file name="$/ProdReporting/frmMDI.frm" version="14" />

 181:     </revision>

 182:     <revision time="5/4/2009 10:10:04 AM" author="Nkelley" comment="">

 183:         <file name="$/ProdReporting/ProdReporting.vbp" version="9" />

 184:     </revision>

 185:     <revision time="5/21/2009 2:40:32 PM" author="Nkelley" comment="">

 186:         <file name="$/ProdReporting/clsLine.cls" version="1" />

 187:         <file name="$/ProdReporting/clsLineSettings.cls" version="1" />

 188:     </revision>

 189:     <revision time="5/21/2009 4:50:42 PM" author="Nkelley" comment="">

 190:         <file name="$/ProdReporting/Globals.bas" version="1" />

 191:     </revision>

 192:     <revision time="5/21/2009 5:14:38 PM" author="Nkelley" comment="Refactored Code and added functionality to print to either a regular printer or a label printer">

 193:         <file name="$/ProdReporting/clsLine.cls" version="2" />

 194:         <file name="$/ProdReporting/clsLineSettings.cls" version="2" />

 195:         <file name="$/ProdReporting/frmDetail.frm" version="8" />

 196:         <file name="$/ProdReporting/frmMain.frm" version="5" />

 197:         <file name="$/ProdReporting/frmMDI.frm" version="15" />

 198:         <file name="$/ProdReporting/modUpdateDatabase.bas" version="5" />

 199:         <file name="$/ProdReporting/ProdReporting.vbp" version="10" />

 200:     </revision>

 201: </revisions>

Step 6: Edit VssMigrate.exe.config to do real import.

 

See Step 3… set PerformImport = True

 

Step 7: Execute VssMigrate.exe again

 

PostImport

 

Step 8: Verify your Subversion Repository

 

Since I Use TortoiseSVN I checked out the project into a folder and then viewed the log:

Subversion

Notice how Rev 43 Includes 7 Modified files… Woot!

VSS does not do this… the latest version of VssMigrate is what causes the Subversion Repository to include the *real* VSS Commit… Thank you guys!

Tags Categories: Uncategorized Posted By: Nathan
Last Edit: 02 Jun 2009 @ 08 31 PM

EmailPermalink
 

Responses to this post » (33 Total)

 
  1. Tim Erickson says:

    Thanks for the post and quickstart guide, Nathan! I’ve taken the liberty of adding a link to this post on the VssMigrate project wiki. OSS FTW!

  2. Nathan says:

    Awesome, I’ll keep it updated as the project evolves. And clear it up some too probably.

  3. Michael H. says:

    When I try to start VssMigrate I got the following error:

    ##### Building file list
    System.InvalidCastException: Das COM-Objekt des Typs “SourceSafeTypeLib.VSSDatabaseClass” kann nicht in den Schnittstellentyp “SourceSafeTypeLib.IVSSDatabase” umgewandelt werden. Dieser Vorgang konnte nicht durchgeführt werden, da der Query
    Interface-Aufruf an die COM-Komponente für die Schnittstelle mit der IID “{2A0DE0EE-2E9F-11D0-9236-00AA00A1EB95}” aufgrund des folgenden Fehlers nicht durchgeführt werden konnte: Schnittstelle nicht unterstützt (Ausnahme von HRESULT: 0×8000
    4002 (E_NOINTERFACE)).
    bei SourceSafeTypeLib.VSSDatabaseClass.Open(String SrcSafeIni, String Username, String Password)
    bei VssMigrate.Program.BuildFileList() in D:\projects\VssMigrate-0.1.0.0\src\Program.cs:Zeile 100.
    bei VssMigrate.Program.Main(String[] argv) in D:\projects\VssMigrate-0.1.0.0\src\Program.cs:Zeile 56.

    I’ve tried with Visual SourceSafe Version 6c (Build 9238) and Version 6d.

    Any help would be most welcome.
    Many thanks in advance!

    Regards
    Michael

  4. Nathan says:

    The Microsoft.VisualStudio.SourceSafe.Interop.dll is expecting Visual SourceSafe 2005. I didn’t realize this may be a prerequisite for this migration. I’m not 100% sure without getting my hands on a copy of an earlier version of VSS and looking for a workaround though.

    Try removing the reference to Microsoft.VisualStudio.SourceSafe.Interop.dll and replace it with a reference to your ssapi.dll file from the VSS install directory and see if that fixes anything. This is really a guess though until I can recreate the issue.

  5. Nils A says:

    I wish VSSMigrate worked for me. I ended up with an SubversionIOException, for a MKCOL-command against the Apache-controlled Subversion server – and I could not figure out how to get rid of it.

    Instead I resorted to http://www.pumacode.org/projects/vss2svn, the Perl script probably being the “grand-father” of VSSMigrate… It worked like a charm :-)

  6. Mee Fong Kwan says:

    Removing the reference to SourceSafeTypeLib and adding a reference to ssapi.dll(it includes its own version of SourceSafeTypeLib) works.

    Will need a a couple of changes to the code to make it compile. Some api is redundant in the ssapi.dll.

    The commented lines didn’t compile, so i replaced it with my changes, what I thought would best fit.

    //var commitArgs = new SvnCommitArgs {LogMessage = versionItem.VSSVersion.Comment};
    var commitArgs = new SvnCommitArgs { LogMessage = vssVersion.Comment };

    //fs.WriteLine(string.Format(“\t”, file.Spec, file.get_Versions(0).Count));
    fs.WriteLine(string.Format(“\t”, file.Spec, 9999));

    I replaced the count with 9999, didn’t know what the equivalent would have been.

    I have started the migration, seems to work. Fingers crossed, hopefully the result will accurate (after my changes :P )

  7. shah0926 says:

    Very useful web site. Truly grateful.

  8. Tablespork says:

    I got an error: “SharpSvn.SvnFileSystemException: Expected FS format between ’1′ and ’3′; found format ’4′.” I replaced the SharpSvn bundled with VssMigrate with the latest 1.6 version and it worked.

  9. Before I go through all the effort of attempting this.

    Can I ask the question : Is it compatible with Visual Source Safe 6.0d?

    – Lee

  10. Dellle says:

    Convertings works so far but I get a couple aof these Warnings:

    WARN Invalid svn status detected for $/MyFolder/MyFolder/MyFile.sln:2

    Waht does this mean?

  11. Very handy thank you. I thought we were going to have to lose our VSS revisions in the transition to SVN – very pleased we could preserve them.

  12. Eric Strehl says:

    First time working with Subversion; am trying to port our 10+ year history of VSS projects over to it so may be missing something. Whenever I move a project, the history of revisions comes out OK, pretty much, but always comes in as whatever I set the SVN user to be as the author of every revision, not different authors as in your example. What am I missing?

    Thanks,

  13. I have tried>>

    Why i am getting the following errors::–

    Please help:(

    ##### Building file list
    ##### Creating directories
    SharpSvn.SvnRepositoryIOException: Unable to open an ra_local session to URL —
    > SharpSvn.SvnRepositoryIOException: Unable to open repository ‘file:///D:/Migra
    tionSetup/SVNRepo/file:/D:/MigrationSetup/SVNRepo/Trunk’ —> SharpSvn.SvnExcept
    ion: Can’t open file ‘D:\MigrationSetup\SVNRepo\file:\D:\MigrationSetup\SVNRepo\
    Trunk\format’: The filename, directory name, or volume label syntax is incorrect
    .
    — End of inner exception stack trace —
    — End of inner exception stack trace —
    at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, SvnException
    error)
    at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, svn_error_t*
    error)
    at SharpSvn.SvnClient.RemoteImport(String path, Uri target, SvnImportArgs arg
    s, SvnCommitResult& result)
    at SharpSvn.SvnClient.Import(String path, Uri target, SvnImportArgs args, Svn
    CommitResult& result)
    at SharpSvn.SvnClient.Import(String path, Uri target, SvnImportArgs args)
    at VssMigrate.Program.ImportDirectories() in D:\Softwares\v0.1.0.0\src\Progra
    m.cs:line 164
    at VssMigrate.Program.Main(String[] argv) in D:\Softwares\v0.1.0.0\src\Progra
    m.cs:line 66

    What is SharpSVN and what to do with this.

    Regards
    Thanks
    WSBokhari

  14. These are the Settings of my Config files::::

    (\$/$)|(\$/Sub1(/Sub1A(/Sub1A2(/Sub1A2a)?)?)?$)|(\$/Sub1/Sub1A/Sub1A2/Sub1A2a.*)

    54: Only one or none of the exclusion/inclusion regex pairs may be set

    55: The regex’s are case-insensitive

    56: Reminder: escape the $/ to \$/

    57: –>

  15. Dear Nathan!!
    I really appreciate the Article :–

    What is the extent of the VSS database that VSSMigrate migrates to Subversion???

    The Most important >> How to deal with Corrupted files in VSS when they convert to Subversion >>> <<<

    Thanks
    Regards
    WSBokhari

  16. Thomas Schukraft says:

    I use the tip of Mee Fong Kwan to get it running with Visual SS 6.0d. Merge worked. But the import to SVN did not work. Any ideas?

    INFO Starting to merge revisions with count of 354
    INFO Merge completed with a final revision count of 201
    INFO ##### Creating directories

    Unhandled Exception: System.AccessViolationException: Attempted to read or write
    protected memory. This is often an indication that other memory is corrupt.
    at svn_pool_create_ex(apr_pool_t* , apr_allocator_t* )
    at SharpSvn.Implementation.AprPool..ctor()
    at SharpSvn.SvnClient..ctor()
    at VssMigrate.Program.GetSvnClient()
    at VssMigrate.Program.ImportDirectories()
    at VssMigrate.Program.Main(String[] argv)

  17. Thomas Schukraft says:

    Ok. Solved the first problem. I used https-URL and after I changed to http-URL it worked. My test project was imported fine.

    But still I have a different problem: I want to import the full VSS-Database (root) but get the message that no project is specified :-( Any idea what to do? There are files in the root-dir with history that I want to migrate.

  18. Kevin J. Conway says:

    Hi:

    I get a nasty error hat the svn:author key can not be opened. I am running CollabNet Subversion 1.6 – the latest. I have a suspicion that the answer is to revert an earlier version of SVN. Any thoughts?

    Thanks.

    kjc

  19. JC says:

    Thanks for the clear article so I could get the C# versions to work. I also needed Tablespork comment about using the 1.6 version of SharpSVN, then it worked fine. If I could figure out why sometimes the dates of the commit are an hour off from the VSS version, things would be perfect. No biggie because the important thing was to get the revisions into SVN.

  20. I really appreciate the write who share this code and things done at my side.

    I have done VSS to SVN Migration successfully. No worries at all.

    The tool i have used only MIGRATE VSS Files one by one to Subversion. No labels Migration at all.

    We have our baselines in VSS that are identified with LABELS. I WANT to migrate Those Labels as TAGS of Subversion.

    IT IS VERY NECESSARY.
    Please Feedback as per your experience.

    i would be more than happy if someone has experienced this issue and get a perfect solution.

    Cheers
    Waseem Bokhari
    00923214294926
    CM Analyst

  21. Meurig says:

    After a few errors I successfully migrated a VSS 6.0d repo to SVN 1.6.

    I needed to apply the fixes as described by Mee Fong Kwan (thank you!).

    I think I saw the same error as Nils A, namely: SharpSvn.SvnRepositoryIOException: Server sent unexpected return value (405 Method Not Allowed) in response to MKCOL request.
    This turned out to be due to directories already existing in the repository. Starting from a fresh/empty repository fixed the issue.

    I also had a number of access exceptions:
    System.UnauthorizedAccessException: Access to the path ‘\\server\repo\db\revprops\1′ is denied.
    These were fixed first by enabling write access on the SMB share hosting the repo and then by an update to the code to remove the read-only flag just before editing those files (they’re created on the fly, so the permissions can’t be fixed en masse up front).
    At the top of the SvnRevProps.Save() method, add the following line:
    if ((myFile.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) myFile.Attributes -= FileAttributes.ReadOnly;
    Note, you probably want to set all these files back to read-only when you’re finished.

    Finally, the following exception turned out to be (I believe) a problem with the McAfee on-access scanner:
    SharpSvn.SvnAuthorizationException: Commit failed (details follow): —> SharpSvn.SvnAuthorizationException: Can’t open ‘C:\Temp\VssMigrate\_migrate\repo\.svn\tmp\tempfile.tmp’: Access is denied.
    Adding the C:\Temp\VssMigrate and all subdirectories to McAfee’s exclude list for the on access scanner fixed that issue.

    After that, it was plain sailing! Many thanks to all contributors.

  22. Jesus says:

    Hello,
    I’m able to migrate my VSS code but I have an issue.
    I have labels on my VSS code and the versions that have a label are not migrated (even they appear in the xml file).
    Does anyone know why?
    Thanks.

  23. sukumar says:

    Hi, I tried using the source code above but when I run it, I am able to see the revisions up until Feb, 2010. Is there something I am missing to do, to see the later revisions after that date. Please let me know asap. Thanks.

  24. mah says:

    what change set of vssmigate was used to migrate from VSS 6.0d repo to SVN 1.6? the lastest code set doesn’t have the same lines that Mee Fong Kwan applied fixes to?

  25. IT Tech says:

    I know I’m probably the last person who still has anyone using VSS, but I’m currently in the process of going through this conversion, and I have to say that these notes and code are awesome! I definitely appreciate all the people that took the time to do this!

    One thing to note: if you are using Visual Source Safe 6.0 and Visual Studio 2008, there are some additional steps that need to be done. Do these steps only if you are using VSS 6.0 and VS2008. They are identified here (http://vssmigrate.codeplex.com/workitem/1869). I was getting errors when running VssMigrate.exe, along the lines of:

    “This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{2A0DE0EE-2E9F-11D0-9236-00AA00A1EB95}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0×80004002 (E_NOINTERFACE)).”

    As I am not a programmer, it took me a while to figure out exactly what they were talking about, but basically the steps are:

    1. Follow everything posted here by Nathan (thanks again!)
    2. Before you compile/build your program, edit the Program.cs. There are basically 2 lines to change:
    - Line 123 = fs.WriteLine(string.Format(“\t”, file.Spec, 9999));
    - Line 481 = var commitArgs = new SvnCommitArgs {LogMessage = vssVersion.Comment};
    3. Remove the existing reference to Interop.SourceSafeTypeLib (Look in Solution Explorer under References). Then, right-click on References and choose ‘Add Reference’. Browse to C:\Program Files\Microsoft Visual Studio\VSS\win32 and click the SSAPI.DLL file. Click OK to add it.
    4. Compile/Build the program
    5. Edit the app.config and/or VssMigrate.exe.config file (if you still need to).
    6. Run VSSMigrate.exe

    Happy Migrating!

  26. ukn742 says:

    @IT Tech you’re not the only one, I happen to have been looking at this the last few days. This program doesn’t like VSS 6.0, so I dug out a copy of VSS 2005, and after a few trial and errors, I got it working, with exception that I get several “Invalid svn status detected”. I’m not a .NET programmer, but it appears that this line “svnClient.GetStatus(filePath, out svnStatus);” returns more than 1 status for a given filePath, strange because filePath should always be a file. The bad thing is that the file simply gets skipped. No idea what to do in this case but will not give up easily!

  27. ukn742 says:

    After further look into invalid svn status detected, it transpired that calling “svn status” manually on the file (located in the temp folder of the project), would print nothing! SVN STATUS does not print files in normal state, so this really means that the file from VSS was committed without any changes, somehow. Safely ignore this error.

  28. ukn742 says:

    Also, since the operation takes a really long time, I created Ramdisk using a free tool from http://www.dataram.com/ . Make sure the repository, the temp folder and the VSS db are all on this ram drive. This should speed things up!

  29. ukn742 says:

    Another discovery: appears the import lost my UTF-8 encoding – make sure you use a tool like Beyond Compare and compare full output from VSS and SVN.

  30. Jmac12 says:

    @IT Guy & Ukn742 Hi Guys

    I’m the same as you two trying to get it to work with VSS 6.0,

    But when i try and add the SSAPI.DLL i get the following message:”Please make sure that the file is accessibile and that is valid assembly or com componet”. I am accessing on a machine that doesnt have source safe. But thought it was type of Library file that i can just add on? Thanks

  31. Jmac12 says:

    I was thick built on the pc with the source safe on and it worked

  32. Jmac12 says:

    When I run it, it stops running when it gets to creating the Directory any ideas?

  33. IT Tech says:

    @Jmac12 – Make sure the SVN user you are using has R/W permissions in the SVN repository you are migrating to. Also, make sure you have R/W permssions in the temp directory you are using.

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 5,888 bad guys.

\/ More Options ...
Change Theme...
  • Users » 1
  • Posts/Pages » 60
  • Comments » 40
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Refactoring



    No Child Pages.

About



    No Child Pages.