Migrating from Visual SourceSafe to Subversion

by Erik Lane 5. November 2008 13:54

For the the last few years I’ve worked with Visual SourceSafe (VSS), Vault, StarTeam, and Subversion.  For me, the easiest and most straight forward is Subversion (SVN).  Don’t get me wrong, if you come from VSS there is a mind shift to how SVN works but it is well worth it.  After I started my last job and I saw that we still used VSS I immediately started pushing for the change to anything but VSS.

This week I got the approval to start migrating all of our source from VSS over to SVN.  There is a great tool to help with that called VSSMigrate.  Reading through the comments I found that Tim Erickson had created a new version written in C# using SharpSVN (10/22/2008 comment).  Sweet Action!

The tool is really good and does an excellent job.  After running the migration I realized that all of the VSS bindings are still in the project/solution files and that the VSS "*scc" files were in SVN.  I used this codeproject article as the basis for the functionality I added that removes all of the VSS binding information and doesn't import any of the *scc" files. 

I emailed the guys at PowerAdmin and the original author but in the event that it doesn’t get posted anywhere I wanted to make it available.

[update this project is now on Codeplex.  Please post issues or comments there. Thanks!]

VssMigrate.Tim2.zip (8.95 mb)

[update: after Dan's comment here is an x86 version that should work on 64 bit systems]

VssMigrate.Tim2(x86).zip (8.95 mb)

Giddy Up!



Dan Mattsson
Dan Mattsson Sweden on 11/13/2008 8:10:24 AM

Thanks for some splendid work! I've been hesitant about migrating but your work (along with Tim's) made it a breeze! Now it's only the small matter of showing the devlopers that it's worth our while... Smile

One minor note, though: the supplied binaries are compiled for "Any CPU", since they have 32-bit-only dependencies that means they will only run on 32 bit machines. Many servers are 64 bits by now and that means that you have to recompile (and have access to VS90) to run on a 64 bit plattform. To make it easier for the masses to use, it would be neat if it was compiled as x86.

eriklane United States on 11/13/2008 10:50:52 PM

Dan - Glad the tool helped you with the migration and thanks for the suggestion.

To be honest, I didn't event think about it but but you are right. I'll recompile them for x86 and update the zip file.

Kristoffer Ahl
Kristoffer Ahl Sweden on 11/26/2008 11:57:55 PM

Thanks for posting! I'm trying it out as I type! So far, so good...

Chris Hoffman
Chris Hoffman United States on 12/4/2008 4:35:56 PM

Erik,  Nice work.  I have been trying to get my employer to switch from vss to svn for about a year.  They are currently on VSS 6 and I received an error while running the conversion.  After about 3 minutes of digging I found out I needed VS 2005 for the tool to work. No Problem.  Installed VS 2005.  Then I got the exception ... SharpSvn.SvnInvalidNodeKindException in... "ProjectName\\bin\\Debug' is not a working copy" this turned out to be caused by the fact that I have Tortoise SVN setup to have the following global ignore pattern....

"*bin */obj *.bak *.*scc *.suo Desktop.ini *.user *.obj *.exe *.pdb *.ncb *.res *.pch *.idb"

Once I removed the global ignore pattern the process completed.  

I know these are not things you can check for in the code but I wanted to post in case anyone else had similar issues.

Thanks for the great tool

eriklane United States on 12/4/2008 5:30:02 PM

Chris - glad you got everything working and posting the info for others as well.

Chris Hoffman
Chris Hoffman United States on 12/5/2008 7:33:29 PM

Ok one more update.  I was getting the vss ole integration error found here


I had to install VSS 2005 SP1 found here and that fixed the issue



Colin Angus Mackay
Colin Angus Mackay on 12/19/2008 1:30:17 PM

Excellent work.

I've got some ideas of additions I'd like to make to this project. I don't suppose it is available in a source control system somewhere? (It would seem somewhat ironic if it wasn't tho') Something like codeplex.

eriklane United States on 12/19/2008 4:27:45 PM

Colin - I think having it somewhere like codeplex is a great idea. I would do that however, I'm not the author of the code...I just added a small new feature to Tim Erickson's code (see the 10/22/2008 comment on PowerAdmin). I'll contact Tim and see if he would be willing to let me put it somewhere like that.

Colin Angus Mackay
Colin Angus Mackay on 12/19/2008 4:38:11 PM

Excellent. Smile

Dan Mattsson
Dan Mattsson Sweden on 1/11/2009 6:29:25 PM

@ Erik & Colin

I've already spoken to Tim about that - he's okay with the code being put up public and says he might contribute as well if he can. Codeplex, SourceForge or perhaps open.collab.net (being SVN and using SharpSVN and all).

I'm also adding a GUI to select source/target and VSS projects to migrate. This will also get rid of the manual settings editing.

We're finally getting through migrating the second part of our repository so I managed to find some time to finalize the work I've begun. Which web repository do you think would work best? Should probably use SVN, Right? Smile

Maddy United States on 1/31/2009 8:46:58 PM

Just wanted to stop by and thank PowerAdmin, Eric and Tim for this great script. VSS is still being actively used at my workplace and we have about 10 years worth of code history, which made the transition very difficult. This script has come as a lifesaver. Thanks a bunch guys for this awesome work.

I too was receiving those OLE errors that Chris Hoffman mentioned and his solution solved the problem as well. For those who would be searching google for this exact error, which I did at first without reading comments on this page, here is the error copy pasted, so that the search becomes quicker ;).

##### Building file list

Unhandled Exception: System.IO.FileNotFoundException: Retrieving the COM class factory for component with CLSID {783CD4E
4-9D54-11CF-B8EE-00608CC9A71F} failed due to the following error: 8007007e.
   at Vss2SvnEnhanced.Program.BuildFileList()
   at Vss2SvnEnhanced.Program.Main(String[] argv)

Steve Cooper
Steve Cooper United Kingdom on 2/2/2009 4:24:13 AM

Just fantastic work. Thanks.

Mahesh Australia on 2/7/2009 5:58:58 PM

First of all I cannot open the solution file. So I changed the exe.config as mentioned in the README file. Now it throws an exception when I run the exe. I might have give wrong values for the keys in the config file. Can anyone guide me? Heres my config file
<?xml version="1.0" encoding="utf-8" ?>
    <add key="VSSWIN32" value="c:\Program Files\Microsoft Visual SourceSafe"/><!-- # VSS\\Win32 directory which contains ssapi.dll-->
    <add key="VSSDIR" value="D:\VSS2SVN Repository\VP"/><!-- #VSS repository directory (contains srcsafe.ini)-->
    <add key="VSSPROJ" value="$/Development/VP"/><!-- #VSS project to start at (ie $/Product)-->
    <add key="VSSUSER" value="Admin"/><!-- #User to use for VSS commands, use blank for none-->
    <add key="VSSPASSWORD" value="password"/><!-- #password to use for VSS commands, blank is OK-->
    <add key="SVNUSER" value=""/><!-- #User to use for SVN commands, use blank for none-->
    <add key="SVNPASSWORD" value=""/><!-- #password to use for SVN commands, blank is OK-->
    <add key="SVNURL" value="svn://localhost/GG"/><!-- #URL to use for the root of the check in-->
    <add key="SVNPROJ" value="file:///C:/svn_repository/GG/MV"/><!-- #SVN project to start at (ie $/Product)-->
    <add key="SVNREVPROPSPATH" value="C:\svn_repository\GG\db\revprops\"/><!-- #SVN Repository directory (ends in [RepositoryName]\db\revprops\)
                                                                              leave blank for no user/date adjustments -->
    <add key="WORKDIR" value="c:\Temp\TempVss2Svn"/><!-- #Directory under which files and directories will be created as work progresses-->
    <add key="DEBUG" value="1"/><!-- #turn on debug output, blank is OK-->
    <add key="AUTORETRY" value="1"/><!-- #if a command fails to run, it will be run automatically 1 time before failing-->

Mahesh Australia on 2/7/2009 8:19:17 PM

Please disregard my last comment. I got it working. Its working fine uptil now. Great tool, loving it. I used VSS2SVN from puma code and the file history wasnt satisfactory. Thanks Erik.

wjandywang United States on 2/9/2009 7:29:40 AM

Hi Erik, i downloaded the code but met a problem when i tried to build it. the exception information is:
Unable to cast COM object of type 'SourceSafeTypeLib.VSSDatabaseClass' to interface type 'SourceSafeTypeLib.IVSSDatabase'. 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: 0x80004002 (E_NOINTERFACE)).

when go step to the folling code
            vssDb = new VSSDatabaseClass();
            vssDb.Open(vssSRCSAFEINI, vssUSER, vssPASSWORD);

i am not sure which component missed. can you help?

wjandywang United States on 2/9/2009 7:33:34 AM

i am using VS 2008,frame work 3.5 and VSS 6.0. i queried in MSDN and know that VSSDatabaseClass should be in Microsoft.VisualStudio.SourceSafe.Interop Namespace. why i annot find this component in your code's reference?


Jeff United States on 2/11/2009 11:46:22 PM


I am trying the migration from an existing VSS root to a fresh new SVN repository. I am getting an exception shown below. When I look for the file in question, "D:\dev\repos\test1\db\revprops\0\2", it doesn't exist. What does exist is a file called "D:\dev\repos\test1\db\revprops\0", as well as two other files 1, and 2. There are no directories under: "D:\dev\repos\test1\db\revprops".

Any ideas?

> VssMigrate.Tim2.exe
##### Building file list
##### Creating directories
File 1/903 : $/gdm/db/2.01/packages.pkg
     Version 1/3
Unhandled Exception: System.IO.FileNotFoundException: Svn props file
File name: 'D:\dev\repos\test1\db\revprops\0\2'
   at Vss2SvnEnhanced.SvnRevProps..ctor(String fileName)
   at Vss2SvnEnhanced.Program.GetAndAddFileVersion(IVSSItem vssFile, IVSSVersion vssVersion, SvnClie
nt svnClient, Boolean isAdd)
   at Vss2SvnEnhanced.Program.GetAndAddFile(IVSSItem vssFile, IVSSVersions vssVersions, SvnClient sv
   at Vss2SvnEnhanced.Program.GetAndAddFiles()
   at Vss2SvnEnhanced.Program.Main(String[] argv)

eriklane United States on 2/12/2009 12:02:13 AM

Jeff / wjandywang - the app has been moved over to Codeplex


Please post these bugs/issues there so there are more people that will get notified and can help.

Jeff United States on 2/12/2009 12:31:28 AM

I figured out the answer to my own question. I had created the repo using svn 1.4.x. I created the repo using the 1.5.4 command line and the tool seems to be working well so far.

Joel United States on 3/10/2009 9:09:40 AM

I'll just add a quick note to respond to wjandywang.  I had the same error and finally tracked down the issue.  I had VSS 6.0d installed.  You need VSS 2005 installed to get this to actually work.  Once I had that installed, it worked without a problem.

hari India on 3/11/2009 2:18:31 AM

    I am geeting exception while starting vssmigrate.tim2.exe

the exception is System.Runtime.InteropServices.COMException

Please help me to fix this issue

eriklane United States on 3/11/2009 12:14:26 PM

Thanks to everyone that has posted here but this project is now on Codeplex - http://www.codeplex.com/vssmigrate

Please post all new issues and comments over there.


devsolo.com on 5/31/2009 10:22:16 AM

Pingback from devsolo.com

     » Blog Archive
     » Migrating Visual SourceSafe to Subversion

Comments are closed