At my work we have a combination of “legacy” Visual Basic applications and more recent J2EE web based applications. The Visual Basic applications use the esteemed Visual Source Safe as their source code repository, whereas we were lucky enough to establish CVS for the Java apps. Well, VSS’s deficiencies in branching and merging have forced us to use CVS for all source (I say “forced”, but this is something I think is a good move and am totally for). So now the challenge is migrating our VSS repository to CVS and maintaining the code history.
The only such tool I have seen to accomplish this is this vss2cvs perl script. However, there doesn’t seem to be any account of a successful conversion effort. Well, this is my attempt to explain how I converted our VSS repository to CVS using this script… Note: I DO NOT claim to know perl. I basically hacked away at this till it worked, please let me know if you see a better way to accomplish any part of this script!
As I’m on a windows client machine, I had to install CygWin with the Perl libraries to execute this command for the transfer:
export CVSROOT=<i>your cvs root</i> perl vss2cvs.pl SSROOT=//GRUEN/VSS SSPROJ=$/<i>your project</i> CVSPROJ=<i>your new cvs proj name</i> SSUSERPASS=rdaigle,<i>your passwd</i>
But first, let’s get the script fixed:
- First of all, it seems there needed to be some initial changes to the script outlined by this post.
Once I did that I was still getting errors about invalid SourceSafe syntax. Turns out the command line call to the VSS executable (ss.exe) was formatting the file path incorrectly. So I had to change that line in the script:
- Line 122 changed from
exec_cmd("ss workfold \"$ssproj\" \"$workdir\\$subdir\" $ssuserpass");toexec_cmd("ss workfold \"$ssproj\" \"$workdir/$subdir\" $ssuserpass"); - After line 145 add the following to remove trailing ”:” from the directory names:
$currdir =~ chomp($currdir); $currdir =~ chop($currdir);
- Before Line 168: (
open(FILETYPE,"ss filetype \"$currfile\" $ssuserpass |");
add$currfile =~ s/\r//g;
to remove leading spaces from the path. - Line 237 of sub resync_file: add
$file =~ s/^ *//;
to remove leading slashes from file path
After that, I started getting erros about not being a CVS module. Turns out the script was trying to get modules from CVS that hadn’t yet been moved over from VSS (the script claims to be able to re-sync repositories, I have not tried this).
- Wrap the
open(CVS,"$cvscmd |");
and subsequent while loop with this “if” statement:if ($alreadyincvs)
Ok, good. At this point I started getting “attempting to use variables not yet initialized” errors and needed to check that the “highestssver” variable at line 424 was initialized before using it.
At this point I noticed that it wasn’t properly finding the labels and had to:
- change line 433 from
if(/^Label: "(.+)"$/)
toif(/^Label:/)
Here is the resulting file that seems to work pretty well for me: (right click -> save as…). Please let me know if I need to clarify anything or what your experiences are with this conversion. There seems to be a lot of interest in it, with very little real solutions. Hopefully we can remedy that and get people off VSS.
As a side note, here is where the script falls short:
- Tags (or “labels” in VSS) don’t seem to get transferred over.
- Branches, forget about it.
- The user and date of the original commit to VSS won’t show accurately in CVS. Instead, the comments for each commit will contain the original user and date. However, I have seen somewhere that executing this *nx command under your CVSROOT will remedy this:
find . -name \*,v -print | while read f; do massagecomments.pl "$f"; done
“massagecomments.pl” can be found at the original vss2cvs.pl download location mentioned at the beginning of the post.
Let me know how it goes.
Paul Glaubitz has kindly given me the updated script he used that properly handles file labels. I’ve updated these links with his version. Thanks, Paul!
Here are the resources mentioned in this post: (right click -> save as…)
- The udpated vss2cvs.pl script.
- The original vss2cvs.orig.pl script.
- massagecomments.pl

Ryan,
I’m very interested in your perl scripts to migrate a VSS database to CVS. Unfortunately, the links do not seem to work for me. Is there some alternate location where I could get them?
Thanks.
Pete
Your links to your modified perl script are no longer working in this post.
you can find the vss2cvs in the news group..
http://web.archive.org/web/*/http://www.laine.org/cvs/vss2cvs
When I click on your link “The udpated vss2cvs.pl script” (that seems to point to http://ryandaigle.com/images/vss2cvs.pl) I get this: Uh oh! It appears as though something has gone awry. This site has recently moved so some of the links may be broken. Please perform a search in the text box in the sidebar to find what you were looking for. Sorry for the inconvenience!
Could you provide me with the script by email or tell me which link I should follow to get it?
Thanks.
Can someone point to the latest script that does the job. Also, if someone could write a wikihow on this, that would be awesome.
Thanks in advance.
Seems like this page is not maintained. Oh Ryan, why hast thou forsaken us?!?
Hi,
I also had the same problem like Jeetendra. We debugged the Source Code of the Programm and found out that the programm couldnt get the files because we were using a German version of Visual Source Safe. Get and install the englisch one – and it works!