Need advice migrating from Visual SVN to Clearcase

scott123's picture
scott123 asked on December 23, 2010 - 2:14am | Replies (9).

We currently have code in VisualSVN and now we are planning to use ClearCase 7.1 as source repository.

I have the requirement to move all the versions in VisualSVN to ClearCase. We do not want to loose any old versions in visualSVN.

Can this be acheived? Please let me know if this is possible, if so let me know the tools or the procedure for migration.

Any help will be highly appreciated.

Thanks,
Scott.

9 Answers

qazwart's picture
qazwart replied on December 23, 2010 - 11:32am.

Answer: No.

The problem is that Subversion and ClearCase really use two completely different ways of looking at your repository. Here are some basic issues:

* Subversion revisions: Because Subversion revisions the whole repository instead of individual files, people use the repository revision as a sort of pseudo tag. You might talk about a piece of software that was built from revision 23323.

ClearCase has no concept of change lists, so you'll lose all that information. To get it, you'll have to create special labels for each and every revision in Subversion and apply them to ClearCase. That'll take forever to accomplish.

* Subversion branches are merely directories designated as branches, and Subversion duplicates the entire directory tree in a branch. ClearCase creates an actual branch, and it uses sparse branching. If out of 10,000 files only one is changed on a branch, only that file is branched. Duplicating this means branching all files for all branches.

Another problem is that there's no easy way to look at the repository and decide what is a branch of what file. In ClearCase, you have a single instance of a file and that instance contains all versions and branches. In Subversion, tags and branches don't necessarily have a logical connection to the file they're from. You can parse the log, but that's going to be difficult.

* Subversion has attributes that have some very specific meaning. The biggie is svn:external. If you used that, you're sunk. There's really no easy way to duplicate this on ClearCase.

The best thing you can do is just lock your Subversion repository as "read only" and bring only the tips of the active software projects over to ClearCase.

Even if somehow you could move your entire history over to ClearCase, it might end up being fairly meaningless. There's no way you can guarantee you can checkout and rebuild, and have it be accurate. In the end, you'll need to keep your Subversion repository up anyway for a while.

By the way, why are you making this switch? I've seem plenty of people go from ClearCase to Subversion, but never the other way around. Your developers are going to throw a fit because it'll take a lot of effort for them to learn the ways of ClearCase, and many of the tools they use might not work.

pdhaggerty's picture
pdhaggerty replied on December 23, 2010 - 1:47pm.

You pose a common question.
Your solution for Base ClearCase will use "clearfsimport" and a view for each branch that SVN has. Each view will have the standard basic branch for ClearCase that will branch ONLY the items that change. After the initial import is performed a label will be applied and this will serve as the branching off point for "Changed Files ONLY" To start use the standard main-latest view for CC.
then identity your base initial version from SVN then use "clearfsimport -recurse -preview {source-location} {target-location}";e.g "clearfsimport -recurse -preview /proj/svn/main/ /usr/vobs/proj"

The dates will be maintained for the initial versions. After the initial import apply a label recurse down the tree.

Create a new CC view with the following ConfigSpec:
element * CHECKEDOUT
element * .../branch-1/LATEST
element * LABEL-MAIN -mkbranch branch-1
element * /main/0 -mkbranch branch-1

Repeat label and new view and branch for each branch.
ONLY THE CHANGES FILES WILL BRANCH! Because clearfsimport will NOT create a new verision if the file did not change. Change lists can be applied by setting attributes.

This can be even more easier if UCM used because then you just need to create the branch from the project explorer then view, no ConfigSpecs needed, much simpler. If you need more details ask for my contact info.

Marc Girod's picture
Marc Girod replied on December 24, 2010 - 5:33am.

MarcGirod wrote: "there will be at least a 'g' one, but you hardly need this fix"

Well, in fact... The 'g' version has a fix for a bug (which I introduced myself in one intermediate version) related to Windows paths normalization. Who knows, there may come an 'h' tar.

I am surprised but feel that my message works as a reply to at least the two posts which followed it.

Marc

Hayley's picture
Hayley replied on January 24, 2011 - 10:29am.

Hello Scott,

Just a quick one about why you are moving from Subversion to ClearCase?

We are looking to do it the other way round, so from ClearCase to Subversion, so I'm interested in why you've chosen to move away from Subversion.

Any information would be greatly appreciated.

Thanks,

Hayley

scott123's picture
scott123 replied on January 25, 2011 - 3:59am.

Its a client requirement and they want the code to be in ClearCase.

pdhaggerty's picture
pdhaggerty replied on January 25, 2011 - 8:28am.

Conversion from SV to ClearCase is very straight forward.
Identify all the Branches in SVN then Identify all the tags. Create Branch types and Label types in ClearCase to Match. Decide if the customer needs to have all the revisions or just the latest from each branch and or what is tagged. Export each tag/branch to an independent location and note what the dates are. Create the initial import to ClearCase from the earliest SVN revision and use main in CC with the basic config branch. Use ClearCase's "clearfsimport" to import each tag/branch. After each import make a baseline label on ALL elements to use as the next import point. Read the doc on clearfsimport to understand how it works you can contact me directly for assistance on this if you wish, I have 20+ years doing conversions from other tools to ClearCase. for the other branches use the standard branch config spec that will ONLY branch items that change. clearfsimport will ONLY make new versions or branches if it changes. see example of config spec below for branching:
element * CHECKEDOUT
element * .../new-branch/LATEST
element * BASELINE-LABEL -mkbranch new-branch
element * /main/0 -mkbranch new-branch

Contract me for more details.

Hayley's picture
Hayley replied on January 25, 2011 - 10:22am.

Thanks Scott.

Did they not like Subversion then?

And what does it not provide them with that ClearCase does?

Thanks,

Hayley

Param M's picture
Param M replied on June 29, 2014 - 11:22am.

Hi,

 

We are also converting from SVN to Clearcase UCM. Could anyone help us if there is any step by step document available to complete this.

 

Thanks in advance.

 

Regards

Param

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.