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: http://cvs2svn.tigris.org/
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):
http://www.python.org/download/windows/
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: http://sourceforge.net/projects/unxutils/
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: http://subversion.apache.org/packages.html
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 http://subclipse.tigris.org/
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 0.0.0.0 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'
By far THE MOST helpful guide to using CVS2SVN I've found. Unless I was being a complete doink, the Tigris.org documentation looks to be far from complete. I can't thank you enough.
I'm glad you found my guide useful, its always good to hear positive feedback.
I can not agree with you any more!
Great step-by-step giude! I have looked exactly something like this. Thanks very much.
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 0.0.0.0’.
There are two hyphons instead of one in front of the word EXISTING (same for LISTEN).
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 🙂
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.
Are you sure you are using the right version of Python?
cvs2svn does not work with Python 3.x
Hi,
Thanks a lot yar!!!!
It helped me a lot in the migaration of cvs to svn with history.
Regards,
Suresh.
This is a great tutorial which made my work too easy...
Thanks a lot
Hi..
Thanks a loot for this wonderful post.
Great work ...
takes beginners like jme a looong way
I doing it 1st time and successfully completed in same day.
Thanks a lot... Great Great work
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.
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!
CVS 'den Git'e history ile geçme
1- http://www.itsqueeze.com/2010/12/using-cvs2sv [Checked By Super Simple Anti Spam By http://dicm.dk/%5D
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.
Hi, Satya, we are following same steps in Windows machine. But getting following error. Can you please help.
Error:
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).
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'
Did anyone have an answer to this?
thank you from 2019, helped me yo recover a long lost code we need now
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'