Migrating Visual SourceSafe to CVS
This HowTo describes the migration from Visual SourceSafe to CVS, keeping the version history.
IMPORTANT: You are doing the migration on your very own risk! I strongly recommend to make a permanent backup of all project data and the SourceSafe database prior to the migration. After the migration, you should thoroughly test the CVS repository before using it in production. At least, you should use diff to check if the latest CVS and Visual SourceSafe files are identical.
The migration is not trivial, and should only be performed by experienced Windows and Linux administrators, who should also have C skills. It is their responsibility to secure the data against possible damage or malfunction.
Why CVS?
Visual SourceSafe (called VSS in the following text) has a few disadvantages against other versioning software. VSS works on file system level using shares, which leads to an inability to access the repository from different time zones or from the internet. Expensive third-party software is required to add such functionality.
Large software projects slow SourceSafe down. Branches are rather simply implemented and not much of practical use. Besides that VSS has a chaotic repository management. Fragments of source are scattered over several files with vacuous names, which makes a manual restauration of the repository impossible.
VSS also does not allow concurrent access to a project. If somebody checked out a file, the other developers have no means to checkout and change this file as well. CVS, on the other hand, allows concurrent access to files by several developers. It will automatically merge all modifications later.
Furthermore, VSS requires Windows, taking you the possibility to use other operating systems for development. CVS can be accessed from virtually any operating system, though.
Finally it is also a question of cost, because a VSS licence isn't quite cheap, bound to a single user, and required third-party tools take another licence to be paid. So you are paying a lot of money for a comparatively moderate piece of software.
CVS solves all those issues. The software has been proven in the professional software development for many years. It is mature, reliable and free of charge. In the following text you will learn how to migrate your VSS repository to CVS. Only free open source software is used for this task, except of Microsoft Visual C to compile the VSSExtractor.
Requirements
For the Windows part, only a computer is required which can access VSS. The user performing the migration, must have full access rights to the repository. The hardware requirements for this computer are rather low, since the VSSExtractor tool is not very memory and CPU consuming.
For the CVS server, Linux is required. We will not consider the case of a CVS server running on Windows. It is not recommended to run a CVS server on Windows, anyways.
You'll need to compile the VSSExtractor tool yourself, so you'll need a recent version of Microsoft Visual C.
Installing CVS
If you haven't installed CVS on your server yet, this is the best time to do it. A detailed description of the installation and initialisation isn't part of this HowTo. A CVS HowTo (e.g. http://www.tldp.org/HOWTO/CVS-RCS-HOWTO.html) will guide you through the installation procedure.
In order to let CVS handle binary files correctly, a change in the cvswrappers
file is required. You can reach it by cvs checkout CVSROOT. There
you should enter at least these lines:
*.[Bb][Mm][Pp] -k 'b' -m 'COPY' *.[Ii][Cc][Oo] -k 'b' -m 'COPY' *.[Aa][Vv][Ii] -k 'b' -m 'COPY' *.[Bb][Ii][Nn] -k 'b' -m 'COPY' *.bz -k 'b' -m 'COPY' *.bz2 -k 'b' -m 'COPY' *.[Dd][Oo][Cc] -k 'b' -m 'COPY' *.[Ee][Xx][Ee] -k 'b' -m 'COPY' *.[Gg][Ii][Ff] -k 'b' -m 'COPY' *.gz -k 'b' -m 'COPY' *.hqx -k 'b' -m 'COPY' *.[Jj][Aa][Rr] -k 'b' -m 'COPY' *.[Jj][Pp][Ee][Gg] -k 'b' -m 'COPY' *.[Jj][Pp][Gg] -k 'b' -m 'COPY' *.mov -k 'b' -m 'COPY' *.mp3 -k 'b' -m 'COPY' *.mpg -k 'b' -m 'COPY' *.[Pp][Dd][Ff] -k 'b' -m 'COPY' *.png -k 'b' -m 'COPY' *.ppt -k 'b' -m 'COPY' *.rpm -k 'b' -m 'COPY' *.sit -k 'b' -m 'COPY' *.srpm -k 'b' -m 'COPY' *.swf -k 'b' -m 'COPY' *.[Ss][Tt][Ww] -k 'b' -m 'COPY' *.tar -k 'b' -m 'COPY' *.tbz -k 'b' -m 'COPY' *.tgz -k 'b' -m 'COPY' *.[Tt][Ii][Ff] -k 'b' -m 'COPY' *.[Tt][Ii][Ff][Ff] -k 'b' -m 'COPY' *.xbm -k 'b' -m 'COPY' *.xls -k 'b' -m 'COPY' *.[Zz][Ii][Pp] -k 'b' -m 'COPY' *.[Aa][Pp][Ss] -k 'b' -m 'COPY' *.[Dd][Ll][Ll] -k 'b' -m 'COPY' *.[Ll][Ii][Bb] -k 'b' -m 'COPY' *.[Ss][Cc][Cc] -k 'b' -m 'COPY' *.[Oo][Pp][Tt] -k 'b' -m 'COPY' *.[Nn][Cc][Bb] -k 'b' -m 'COPY' *.[Ss][Uu][Oo] -k 'b' -m 'COPY'
You can add this list by further known binary file extensions.
Migration
The open source tool VSSExtractor will be used for migration. Anyhow the tool has some minor flaws and also seems not to be maintained any more, so a few patches are required to make it work.
All required patches you'll find in the Download area of the Shredzone, in a file called Fixpack.
Setting up the CVS server
For migration, a specially patched CVS version is required on the server side, which can be deleted after migration.
First you'll need the source of CVS V1.11.2. The patches can only be applied to this version. First unpack the archive into a directory.
To make the CVS tool to the cserver tool, you'll need the cserver patch from the VSSExtractor project. You'll find this patch on the VSSExtractor's project page. Unpack this file, copy the cserver patch along with the bugfix patch from the fixpack, into the CVS directory, and apply both patches. After that, compile the source.
cd /path/to/cvs-1.11.2 patch -p1 < cserver-0.7.1-cvs-1.11.2.patch patch -p1 < cserver-0.7.1-bugfix.patch ./configure make
After that you'll find a cserver binary and a cserver.conf file in the src/ directory.
Change the cserver.conf file to meet your requirements. In [logFile] you should set an absolute path to a log file used for the import log. [Cvsroot] should point to the directory of the CVS repository.
The preparations have been completed on the CVS server side now.
Building VSSExtractor
On Windows side, the VSSExtractor tool will communicate to Visual SourceSafe and transport the extracted data to the cserver via network.
The precompiled VSSExtractor.exe is only to be used for a German language Visual SourceSafe installation, so most probably you'll need to compile this tool yourself. You'll require Visual C Studio.
Unpack the VSSExtractor source from the VSSExtractor project. You do not need to apply the Timestamp/Filename patch from the website, since it is included in the fixpack patch already.
Now apply the patch from the fixpack:
patch -p1 < VSSExtractor-0.7.1-fix.patch
You must not apply the German patch, unless you have installed a German version of Visual SourceSafe.
Now you need to download and compile Xerces 2.4.0 or higher from the Apache website. After that, the include files (xerces-c-src2_4_0\src\ and xerces-c-src2_4_0\src\xercesc\) and the Xerces lib have to be added to the VSSExtractor project. The VSSExtractor source should compile now. After that, copy the generated exe, the VSSExtractor.ini and the Xerces DLL to a common directory.
The Migration
In preparation, you should made sure that all VSS files have been checked in, and that nobody will use the VSS repository while the migration is in progress. Now you should make a permanent backup of the project files and the entire VSS repository. The migration which will follow now, can take several hours depending on the size of the project.
In the VSSExtractor.ini the VSS paths and the name of the cserver server will be entered first. On the CVS server you can now start the cserver as root:
./cserver
On Windows side, enter the VSS project to be migrated, into the VSSExtractor.ini. The migration process will be started by invoking the VSSExtractor.exe now.
After a while, the Notepad will open and show an XML file. You can check it and e.g. enter the CVS users corresponding to the VSS users. After closing the Notepad, the transfer of the files to the CVS server will be performed. There is no further interaction required, so you can e.g. let this part run during the night.
Eventually the entire project including history, should be found in the CVS repository. Anyhow, it is recommended to check out the project both from VSS and CVS and compare it using diff. Besides the CVS directories, mssccprj.scc and vssver.scc files, there must not be any differences. It is also recommended to check the log files of both tools for any errors.
Cleanup
After the last migration is finished, the cserver can be shut down using Ctrl-C. Now you can delete the entire cserver source. This tool was only meant for the migration, and does not replace the regular CVS server. On Windows side, the VSSExtractor tool can be deleted entirely.
The migration has been completed. CVS can now take over all VSS tasks, and VSS should be turned off now for securitry reasons (so nobody will check in any files there by mistake).
Useful Links
- http://www.cvshome.org/
- The CVS homepage, with sources, manuals etc.
- http://ccvs.cvshome.org/servlets/ProjectDownloadList?action=download&dlID=115
- CVS V1.11.2 which is required for the patches
- http://sourceforge.net/projects/vssextractor/
- The Sourceforge project page of VSSExtractor
- http://www.tldp.org/HOWTO/CVS-RCS-HOWTO.html
- HowTo install a CVS server
- http://www.shredzone.net/download/software/VSSExtractor-Fixpack.zip
- Fixpack for VSSExtractor and cserver
- http://xml.apache.org/xerces-c/index.html
- Xerces is a free XML parser required by VSSExtractor
- http://www.tortoisecvs.org/
- A free tool to integrate CVS to the Windows Explorer.
- http://cvssccplugin.sourceforge.net/
- Adds CVS to Visual Studio, using Tortoise.
- http://www.wincvs.org/
- WinCVS is a Windows port and a GUI frontend for CVS.
- http://gruntspud.sourceforge.net/
- An excellent CVS GUI written entirely in Java.
- http://www.highprogrammer.com/alan/windev/sourcesafe.html
- A report about VSS experiences.
Windows, Visual SourceSafe and Visual Studio are trademarks of the Microsoft Corporation. Courtesy of Böhnke+Partner for allowing me to publish this HowTo and the Fixpack on my homepage.

