This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes CVS to Subversion Migration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "CVS to Subversion Migration" Watch "CVS to Subversion Migration" New topic
Author

CVS to Subversion Migration

Dave Steinberg
Author
Greenhorn

Joined: Aug 18, 2003
Posts: 20
Hi Jeffrey,

The benefits offered by Subversion over CVS are very appealing -- I'd love to switch over as soon as possible. Is it possible to maintain the history from existing CVS modules in Subversion, or would you have to import the latest state and "start again", keeping the old CVS repository around? In general, how easy or hard it it to make the migration, and are there any gotchas?

Congrats on the book, and thanks for the appearance to answer our questions.


Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0131425420/ref=jranch-20" target="_blank" rel="nofollow">Eclipse Modeling Framework</a>
Eusebio Floriano
Ranch Hand

Joined: Mar 07, 2004
Posts: 235
Hi Jeffrey,
One more question:
do you think that anyone with a good know-how in CVS can easily learn do the same things in subVersion ?

Regards,


SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
I haven't found on the free documentation such a hint of migrating the full CVS history to subversion.

In big lines the functionality behind CVS and subversion are the same. The principles are a little bit different ;-).

--
./pope
[the_mindstorm]


blog - InfoQ.com
Jeff Machols
author
Ranch Hand

Joined: Sep 07, 2004
Posts: 43
There is a tool called cvs2svn http://cvs2svn.tigris.org/ that does a pretty good job of converting a repo. I cover it briefy in the book. I found trying to history is easy and works pretty well, the tricky part is getting branches and tags. This is another tool that is developed "outside" subversion and started out slow. A lot of the early bugs have been fixed, but if you are willing to leave the branches and tags and just bring the history, you have a good chance of the migration working.

If you have a good working knowledge, moving to Subversion is not difficult. The biggest problem is the idea of Atomic commits. At first I hated it, but now I think it is far better than the traditional file by file versioning.
[ January 18, 2005: Message edited by: Jeff Machols ]

Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394362/ref=jranch-20" target="_blank" rel="nofollow">Subversion in Action</a>
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
An interesting info: Eclipse team has introduced in the development of 3.1 version the notion of commit groups. They are not actually atomic commits, but they are introducing in a way this idea.

--
./pope
[the_mindstorm]
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Jeff i've been looking for this info, but i guess it may be undercover . Is it possible to change the numbering mode? I've started to dislike the version 103 .

--
./pope
[the_mindstorm]
Jeff Machols
author
Ranch Hand

Joined: Sep 07, 2004
Posts: 43
Ali - I do not think this can be done, are you trying to do something 1.1, 1.2?
Ken Krebs
Ranch Hand

Joined: Nov 27, 2002
Posts: 451
Is there a document that describes the process of converting a repo from CVS to Subversion ?


kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by Jeff Machols:
Ali - I do not think this can be done, are you trying to do something 1.1, 1.2?


Yes. For me - probably the years spent with CVS sign - a 1.19 is very different from a 2.1 and from a 1.11.1.34.
Maybe I can get used to not have the branching numbers, but having just incremental versions without a possibility to mark a step is in a way annoying.

--
./pope
[the_mindstorm]
Jeff Machols
author
Ranch Hand

Joined: Sep 07, 2004
Posts: 43
Ken,

Here is part of article I wrote, it should get you started

Once you are ready to move to CVS, there are several decisions that need to be made before proceeding. The first decision is whether or not to keep revision history and log messages. If it seems like an opportune time to baseline your code, maybe you won�t need the history. Should this be the case, a simple copy into your Subversion working directory and commit will load the repository. In the more likely case you decide to keep your history, it is time for the next choice: do you bring branches and tags from CVS into the Subversion repository? Unfortunately, due to constraints in the conversion mechanism, this is all or nothing. Either you get all the tags and branches, or just the trunk.

Subversion has a tool to import an existing CVS repository, including history, branches and tags. This process can get a little dicey depending on your CVS repository. Basically, the more straight forward your CVS implementation, the higher chance of success in the conversion process. If you have a lot of branches and have moved or deleted entries from the CVS repository, you may be in for a long night. The conversion tool is a python script called cvs2svn.py. This script is packaged with Subversion but it is maintained separately. This utility is lagging behind the Subversion code in terms of production worthiness (which could be one of the reasons it is separate). The good news is the tool is being improved at a quick pace. I would recommend getting the latest version before trying to run the conversion. You can check out the script and documentation from collabnet:

svn co http://svn.collab.net/repos/cvs2svn

Once you have the script, take a look at the README and run cvs2svn.py --help. It should not take long to skim through this and be ready to give the conversion a try. The script has the ability to perform a dry run. This will make sure it can properly parse the CVS repository with actually doing the conversion. It is not a bad idea to try this and see if you have any issues before going through the actual conversion. The success and speed of the conversion will depend on many factors. If you hit a snag, here are a few suggestions:

�If possible, run the conversion on the box your CVS repository is on. If you cannot do this, see if you can get a tarball of the repository (maybe from a backup) and create it on your local machine. If you have a big repository, it will be worth the effort.
�Leave braches and tags behind. This is where I have run into the majority of my problems. If you are getting stuck on the braches, try running the conversion with the --trunk-only option. If you need the source from the branches, manually create them in Subversion. You will lose the branch history but not the HEAD history.
�Make sure you have plenty of disk space. The conversion will create a good amount of temporary files.
�Try the conversion first on a test Subversion repository. If you are adding to an existing SVN repository, you do not want to get half way through and have an error put your existing code in a bad state.
�Create a dump file first. The cvs2svn script can be run to create a Subversion dump file using the --dump-only option. This dump file can be imported into an SVN repository. This is especially useful if you run into problems on the Subversion side. Once you have the dump of the CVS repository, you can use this file instead of reading from CVS each time.
Ken Krebs
Ranch Hand

Joined: Nov 27, 2002
Posts: 451
Thanks for your description of the migration process Jeff.

The most appealing thing to me about Subversion over CVS is that the structure of the repository is actually part of the information being managed. I like to take advantage of my ide's (Eclipse) ability to allow me to ruthlessly refactor. This results in lots of name and package changes or the moving of stuff around, especially during the early stages of a project. CVS can create a fair amount of inertia in this regard resulting in less than ideal names or packaging.
Jeff Machols
author
Ranch Hand

Joined: Sep 07, 2004
Posts: 43
Ken - the ease of refactoring can be a huge benefit. I actually got started in Subversion when I project I was working on went from sourceforge to Apache. I was "elected" to be the infrastructure contact and Subversion was suggested. We converted the repo then did the refactor, it tool a couple hours. I can't imagine how long it would have taken with CVS.

Another nice thing about the directory structure being versioned is the ability to recreate the repository. Say you make a change and a week later need to back up to a previous revision for some reason. If files moved, or tags/labels(properties) changed...it can be very difficult to get back to the same state. With Subversion, everything gets back to the original state which is great if you need to compile or deploy off from an old revision.
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 762
I hate to ask... anyone done a StarTeam to CVS history conversion?

-j-


Books: Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by Ken Krebs:
[...] I like to take advantage of my ide's (Eclipse) ability to allow me to ruthlessly refactor.[...]


Ken be aware of the fact that subclipse is working pretty well on Win machines the other platform solutions are not quite good (afaik), and however the plugin is not at the level of CVS support in Eclipse.

--
./pope
[the_mindstorm]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CVS to Subversion Migration
 
Similar Threads
Undeployed application
cvs subvserion combined ?
Generating change logs from Subversion
why subversion ?
difference betweeb subversion and cvs