Using cvs2svn¶
NOTICE:
This page is under construction, and hasn't been fully tested.
Some users have expressed an interest in migrating their existing CVS repositories
to SVN. This wiki page will attempt to walk you through the process. We'll be showing
the commands you type and the output you get in the following format:
command you type
output you get
Overview¶
There are a few steps to converting CVS modules to Git here on cdcvs:
- Finding your existing cvs module
- checking for space requirements
- environment setup
- running cvs2svn
- cleanup
We'll go through them in detail.
Finding your existing module¶
You need to know the $CVSROOT value for your repository for this part. You can look in a checked-out
copy at the CVS/Root file if you're not sure what it is. The examples here will be as if you had a Redmine-created
repository 'myproject', which would have a $CVSROOT value of p-myproject@cdcvs.fnal.gov/cvs/projects/myproject.
You want to ssh into cdcvs using the user@cdcvs part of your $CVSROOT.
ssh p-myproject
@cdcvs.fnal.gov
Last login: ...
Then change directories to the directory part of your $CVSROOT.
cd /cvs/projects/myproject
ls
CVSROOT myproject
Check for space¶
There needs to be at least double the space your package takes free for the conversion.
du -sk myproject
800 myproject
df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
blue1:/cdcvs 314572800 240312928 74259872 77% /cvs
So the Available space (the 74259872 in the above example) must be atleast double the size of the project (800 in the above example) to consider proceeding. If it isn't, or it's within 10% or so, please put in a servicedesk ticket, and ask us to grow the filesystem.
Setup your environment¶
You'll probably need to use the cvs 1.12 that we use behind Redmine to do the conversion, and with
our /usr/local/bin/cvs_wrap script to hide some WARNINGS it gives that cvs2svn doesn't like.
. /fnal/ups/etc/setups.sh
setup cvs v1_12_13p1
echo $CVS_DIR
/fnal/ups/db/../prd/cvs/v1_12_13p1/Linux-2
Run the cvs2svn tool¶
cvs2svn \
--username=cvs2svn \
--cvs=/usr/local/bin/cvs_wrap \
--svnrepos `pwd`/myproject.svn \
`pwd`/my-module
Examining all CVS ',v' files...
/cvs/projects/myproject...,v
/cvs/projects/myproject...,v
...
Timings (seconds):
------------------
9.43 pass1 CollectRevsPass
0.03 pass2 CleanMetadataPass
0.01 pass3 CollateSymbolsPass
...
10.05 total
Test it¶
Now, in a window on another box, we want to check out both trees, and
compare them.
mkdir /tmp/compare
cd /tmp/compare
cvs -d p-myproject@cdcvs.fnal.gov:/cvs/projects/myproject co myproject
cvs checkout: Updating myproject
U myproject/...
svn co svn+ssh://p-myproject@cdcvs.fnal.gov/cvs/projects/myproject/myproject.svn/trunk
A myproject.svn/trunk
A myproject.svn/trunk/...
diff --recursive myproject myproject.svn/trunk
Only in test-cvs: CVS
Only in test-cvs.svn/trunk: .svn
...
The only differences should be CVS and .svn directories, and the occasional $Id:..$
line.
Update Redmine¶
If your repository is affiliated with a Redmine project, you can now set Redmine to look at your new repository.
- Go to the Settings tab of your project
- Click on the Repositories sub-tab.
- Click on the link next to the current repository (this doesn't delete the actual files, just Redmine's info about where the repository is).
- Click the link
- Choose "Subversion" for the SCM
- Check the Main Repository checkbox
- Put the
file:///
full URL path to your new my-project.svn directory in the Path to repository box. - Clear the Login and Password fields
- Click Save