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!


Tags:

Comments

Dan Mattsson
Dan Mattsson Sweden on 11/12/2008 6:10:24 PM

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
eriklane United States on 11/13/2008 8:50:52 AM

eriklane
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 9:57:55 AM

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 2:35:56 AM

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
eriklane United States on 12/4/2008 3:30:02 AM

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

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

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

http://support.microsoft.com/kb/934723

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

http://support.microsoft.com/kb/943847

--Chris

Colin Angus Mackay
Colin Angus Mackay on 12/18/2008 11: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
eriklane United States on 12/19/2008 2:27:45 AM

eriklane
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 2:38:11 AM

Excellent. Smile

Dan Mattsson
Dan Mattsson Sweden on 1/11/2009 4:29:25 AM

@ 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
Maddy United States on 1/31/2009 6:46:58 AM

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 ;).

C:\........>VSSMigrate.Tim2.exe
##### 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/1/2009 2:24:13 PM

Just fantastic work. Thanks.

Mahesh
Mahesh Australia on 2/7/2009 3:58:58 AM

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" ?>
<configuration>
  <appSettings>
    <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-->
  </appSettings>
</configuration>

Mahesh
Mahesh Australia on 2/7/2009 6:19:17 AM

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
wjandywang United States on 2/8/2009 5:29:40 PM

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
wjandywang United States on 2/8/2009 5:33:34 PM

PS,
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?

thanks
andy

Jeff
Jeff United States on 2/11/2009 9:46:22 AM

Hello,

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
nClient)
   at Vss2SvnEnhanced.Program.GetAndAddFiles()
   at Vss2SvnEnhanced.Program.Main(String[] argv)

eriklane
eriklane United States on 2/11/2009 10:02:13 AM

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

http://www.codeplex.com/vssmigrate

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

Jeff
Jeff United States on 2/11/2009 10: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
Joel United States on 3/9/2009 7:09:40 PM

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
hari India on 3/10/2009 12:18:31 PM

Hi,
    I am geeting exception while starting vssmigrate.tim2.exe

the exception is System.Runtime.InteropServices.COMException

Please help me to fix this issue

eriklane
eriklane United States on 3/10/2009 10: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.

Thanks!

pingback
devsolo.com on 5/30/2009 8:22:16 PM

Pingback from devsolo.com

devSolo
     » Blog Archive
    
     » Migrating Visual SourceSafe to Subversion

pingback
behaviorchart.interactiveinfonet.info on 9/7/2010 3:05:35 AM

Pingback from behaviorchart.interactiveinfonet.info

Kid behavior chart - Free behavior - Behavior chart

Comments are closed