R – Moving from SVN to ClearCase

clearcasesvn

So, it's the opposite way round this time – I need to migrate a SVN-based project into ClearCase. Is there any tools out there that'd make the process a bit easier (rather than putting together a custom script) and are there any gotchas from anyone who has had experience doing this?

Thanks!

Best Answer

As mentioned here (ibm) and in this thread, there is no direct tool to import SVN data to ClearCase.

That means a custom script setting your SVN workspace to relevant milestone, and then clearfsimport those into a ClearCase view with a "proper" config spec (i.e. "configuration specification").

By proper, I mean a ClearCase view importing into the relevant ClearCase branch the different copies of Subversion files located into 'branch directories'. And then importing in the right order the 'tags' (still copies in the SVN repo) in the ClearCase import view, with a label set right after that kind of import.

So the main 'gotcha' is to blindly import the all SVN structure: that would result in actual directories which should not be present at all in ClearCase, since branches and tags are first-class citizen with this tool, and not 'cheap copy' like in SVN.

A good script to start with (and to adapt of course) would be svn2git which does detect SVN branches and tag, and try to import the content of those 'directories' into git, (but could also import them into ClearCase, through the right system call to the 'clearfsimport' command').

Since the import of a single revision can be fairly long, a realistic approach would be to limit the script to only import:

  • tags
  • HEAD of trunk
  • HEAD of the declared branches

When importing branches, that means creating the brtype, and then setting a label (a starting point), finally changing the config spec in order to get the following selection rules:

element * .../svnBranch
element * STARTING_LABEL -mkbranch svnBranch
element /main/0 -mkbranch svnBranch

The important point is to have an end result without the directories representing branch and tag present in SVN.
From there, you will be able to move/rename the main directories into whatever structure you want, like the one suited for UCM component declaration (if you want to use UCM).