• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CVS to Subversion Migration

 
Author
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
 
author
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ali - I do not think this can be done, are you trying to do something 1.1, 1.2?
 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a document that describes the process of converting a repo from CVS to Subversion ?
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hate to ask... anyone done a StarTeam to CVS history conversion?

-j-
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic