Question

My company currently uses two separate CVS repository for all of its projects.

My boss has chosen to migrate to SVN at one condition: migration must be gradual and must cause at least downtime as possible.

Given that I will keep the multi-repository structure (so customer software goes to repo1 and internal software to repo2, even if this distinction is not strictly necessary), I would like to ask if it's possible to periodically nominate a project for migration from CVS to SVN and migrate it to an existing repository.

Let me explain better. With an example involving only one repo for simplicity.

  • Day 0: SVN repo init
  • Day 1: new project (call it P) starts, developer commit to SVN repo
  • Day 2: old project A, not developed anymore, is candidate for migration. All developers are agreed to commit latest modifications to CVS and use SVN after migration if they ever need it
  • Day 3: Cycle repeats from steps 1 or 2

Normally, cvs2svn can generate a dump file (I already made a few successful attempts) that can be imported with svnadmin load to an empty repository. And normally cvs2svn can be used to generate a dump for one or multiple chosen projects (there are a few tutorials about it, all run successfully).

Putting it all together

Since I can generate anytime a dump for any chosen set of CVS project, say A, B, C, can I (and how) use those dumps to append those revisions to the SVN repository where projects, say P and Q, already exists?

Clarification: I expect the filesystem layout to look like

/svnroot
    /projectA
        /branches
        /tags
        /trunk
    /projectX
        /branches
        /tags
        /trunk
Was it helpful?

Solution

I was going to give you a slightly curt answer pointing out that what you want is documented in the cvs2svn FAQ. But then I realized that that I edited away that part of the FAQ entry years ago (my mistake, sorry!). So I just added it back to the FAQ, for you and for posterity.

The idea is to convert each project to a dumpfile, placing its trunk, branches, and tags directories where you want them to end up:

cvs2svn --dumpfile=/tmp/projectA.dump \
        --trunk=projectA/trunk \
        --branches=projectA/branches \
        --tags=projectA/tags \

and then load the dumpfile into the existing Subversion repository:

svnadmin load /svnroot </tmp/projectA.dump

The advantage of using a dumpfile for subsequent migrations is that the Subversion repository only needs to be taken offline for the duration of the svnadmin load, rather than for the whole time that cvs2svn is running.

OTHER TIPS

Since I can generate anytime a dump for any chosen set of CVS project, say A, B, C, can I (and how) use those dumps to append those revisions to the SVN repository where projects, say P and Q, already exists?

Yes, since

a) creating dump is just one of possible results for executing cvs2svn (other is direct import of converted repo)

b) importing additional disjoint dumps does nor overwrite old data in repository

c) cvs2svn docs clearly states:

--existing-svnrepos Load the converted CVS repository into an existing Subversion repository, instead of creating a new repository. (This option should be used in combination with -s/--svnrepos.) The repository must either be empty or contain no paths that overlap with those that will result from the conversion. Please note that you need write permission for the repository files.

(i.e you can't revisions from in trunk from dump to existing trunk, but can - to branches, if they does not exist before)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top