Working smarter not harder

Using cvs2svn on Windows (Converting a CVS repository to SVN)

After running into multiple problems while trying to setup cvs2svn conversion scripts to test on my local windows machine I decided to create a guide to help anyone who is going down this path.

Step 1. Download/Extract Scripts
First you will need to get the actual scripts that do the conversion process.

Download the cvs2svn scripts:

Extract the cvs2svn directory to wherever you want it. e.g C:\cvs2svn-2.3.0

Step 2. Download/Install Python

The cvs2svn scripts are written in Python so you will need to install Python to run them.

Download Python (check which version is required by cvs2svn, at time of writing v3 wasn't supported):

Install Python.

Add the Python root directory to your PATH (e.g C:\Python27). Then open command prompt and make sure it is working by typing 'python'

Step 3. Download/Extract Unix Utils

The cvs2svn scripts require the Unix sort tool to run, the easiest way to get around this on Windows, is to use the unxutils tools.

Download GNU sort for windows:

Extract the utils e.g to C:\unix-utils\

Step 4. Download/Install Subversion

There are a number of Subversion packages for Windows, I used Slik SVN.

Download Subversion:

Install Subversion.

Note for Slik SVN: Make sure you select custom setup and select SvnServe (this installs the svn server).

When install has finished open command prompt and make sure svn is working by typing 'svn'

Step 5. Do the CVS to SVN conversion

Create a new directory for your svn repo e.g C:\svn-repo

To create the SVN repository go to the command line and type ‘svnadmin create c:\svn-repo\repo’

Finally to run the conversion scripts go to the wbin dirctory of the GNU utils (e.g C:\unix-utils\usr\local\wbin) and type 'python C:\cvs2svn-2.3.0\cvs2svn -s c:\svn-repo\repo --existing-svnrepos c:\data\cvs_repo\repo\TestApp'

Note: If you get the error ‘ERROR: Command failed with return code 1: "sort -T cvs2svn-tmp cvs2svn-tmp\revs-summary.txt"’ this is because you did not run the script inside the GNU utils wbin directory.

Next you will need to start-up svnserve so you can connect to your new repository. You can setup svnserve to run as a windows service but for the sack of simplicity for this tutorial we will just run it as a deamon. To run svn server as a daemon type 'svnserve -d'into the command prompt.

Step 6. Accessing your new SVN repository

Install the Subclipse plugin for your version of Eclipse

Connect to the repo e.g. svn://localhost/svn-repo/repo

Note: On Windows Vista/7 if you get the error ‘No connection could be made because the target machine actively refused it’ when trying to connect to your Subversion repository you need to start svnserve with the parameter --listen-host this has something to do with IPv6.

How can I convert project foo so that trunk/tags/branches are inside of foo?

This is useful when you want to create an SVN repository that has multiple projects inside it.

If foo is the project that you want to convert, then run cvs2svn like this:

Python C:\cvs2svn-2.3.0\cvs2svn -s c:\svn-repo\repo --existing-svnrepos --trunk=foo/trunk --branches=foo/branches --tags=foo/tags c:\data\cvs_repo\repo\foo'


  1. V R P's Gravatar V R P
    February 14, 2011    

    By far THE MOST helpful guide to using CVS2SVN I've found. Unless I was being a complete doink, the documentation looks to be far from complete. I can't thank you enough.

    • admin's Gravatar admin
      February 19, 2011    

      I'm glad you found my guide useful, its always good to hear positive feedback.

    • April 4, 2017    

      I can not agree with you any more!

  2. mellda's Gravatar mellda
    May 23, 2011    

    Great step-by-step giude! I have looked exactly something like this. Thanks very much.

  3. mellda's Gravatar mellda
    May 23, 2011    

    Only note: in my case I have to use this command for conversion:
    ‘python C:\cvs2svn-2.3.0\cvs2svn -s c:\svn-repo\repo --existing-svnrepos c:\data\cvs_repo\repo\TestApp’. That is: --existing-svnrepos instead of -existing-svnrepos. The same in command ‘svnserve -d --listen-host’.

    • mellda's Gravatar mellda
      May 23, 2011    

      There are two hyphons instead of one in front of the word EXISTING (same for LISTEN).

      • admin's Gravatar admin
        May 24, 2011    

        Thanks for the heads up, turns out wordpress automatically replaces the double dashes with a single one. I have worked some magic which has fixed the article.
        Thanks again 🙂

  4. Mike's Gravatar Mike
    July 13, 2011    

    I really need your help...

    I'm intending to do the step where you migrate the repositories from CVS to SVN but when I execute the command
    'python cvs2svn ...'

    The compilation from python results in this..
    File "cvs2svn", line 71
    except FatalException, e:

    Is there a way to solve this?

    Thanks a lot for your help!
    This guide it's pure gold.

    • timothyja's Gravatar timothyja
      July 18, 2011    

      Are you sure you are using the right version of Python?

      cvs2svn does not work with Python 3.x

  5. suresh's Gravatar suresh
    November 11, 2011    


    Thanks a lot yar!!!!
    It helped me a lot in the migaration of cvs to svn with history.


  6. Ahmed Ali's Gravatar Ahmed Ali
    December 14, 2011    

    This is a great tutorial which made my work too easy...
    Thanks a lot

  7. cvs@svn converter's Gravatar cvs@svn converter
    December 15, 2011    


    Thanks a loot for this wonderful post.
    Great work ...
    takes beginners like jme a looong way

  8. Anand's Gravatar Anand
    April 3, 2012    

    I doing it 1st time and successfully completed in same day.
    Thanks a lot... Great Great work

  9. Dee's Gravatar Dee
    June 5, 2012    

    Thanks for the great guide, it has been really helpful.

    One thing to note, if you plan on using something like CollabNet's SubversionEdge, it is best to do the conversion first with a basic version of svn, such as SilkSVN, as recommend in the guide. SubversionEdge (3.0.1) installs a non-standard version of Python 2.5 which can cause problems with the cvs2svn process.

  10. Muhammad Murad Korejo's Gravatar Muhammad Murad Korejo
    June 24, 2017    

    This guide is good. If you are running CVSNT on Windows, the advice is to use the same cvs.exe you normally use with cv2svn, but this won't work in Cygwin. You need to call cvs2svn from a Windows shell as described in this article. I created and edited a cvs2svn options file as well in Linux to run with cvs2svn.

    Nice work, even 7 years later!

  11. Satya Kumar's Gravatar Satya Kumar
    October 21, 2018    

    It was very useful, simply followed the steps as explained and it worked out perfectly. Thanks a lot for sharing the knowledge and guide.
    God Bless you.

    • Manoj Tumati's Gravatar Manoj Tumati
      December 2, 2018    

      Hi, Satya, we are following same steps in Windows machine. But getting following error. Can you please help.

      c:\unix-utils\usr\local\wbin>python C:\cvs2svn-2.3.0\cvs2svn -s c:\svn-repo\repo --existing-svnrepos c:\data\cvs_repo\repo\folders
      ----- pass 1 (CollectRevsPass) -----
      Examining all CVS ',v' files...
      ERROR: No RCS files found under 'c:\\data\\cvs_repo\\repo\\folders'!
      Are you absolutely certain you are pointing cvs2svn
      at a CVS repository?

      Pass 1 complete.
      Error summary:
      ERROR: No RCS files found under 'c:\\data\\cvs_repo\\repo\\folders'!
      Are you absolutely certain you are pointing cvs2svn
      at a CVS repository?

      Exited due to fatal error(s).

      • Jay Indla's Gravatar Jay Indla
        November 26, 2019    

        Hi, Satya, I am running into an issue when I try the
        c:\unix-utils\usr\local\wbin>python C:\cvs2svn-2.3.0\cvs2svn -s c:\svn-repo\repo --existing-svnrepos c:\data\cvs_repo\repo\

        C:\Python27\python.exe: can't find '__main__' module in 'C:\\cvs2svn-2.3.0\\cvs2svn'

  12. albert's Gravatar albert
    March 29, 2019    

    thank you from 2019, helped me yo recover a long lost code we need now

  13. Jay Indla's Gravatar Jay Indla
    November 26, 2019    

    I am getting an error when I try the following command.
    'python C:\cvs2svn-2.3.0\cvs2svn -s c:\svn-repo\repo --existing-svnrepos c:\data\cvs_repo\repo\TestApp'

    C:\Python27\python.exe: can't find '__main__' module in 'C:\\cvs2svn-2.3.0\\cvs2svn'

2 Trackbacks

  1. Confluence: BILGITABANI on January 10, 2018 at 11:25 am
  2. Confluence: eTravel on September 6, 2018 at 8:16 am

Leave a Reply

Your email address will not be published. Required fields are marked *