How-to:
If you need to convert certain CVS modules (in one large repository) to Subversion now and other modules later, you may want to convert your repository one module at a time. This situation is typically encountered in large organizations where each project has a separate lifecycle and schedule, and a one-step conversion process is not practical.
To incrementally migrate modules contained within a CVS repository to Subversion you will need to use cvs2svn to create a "dumpfile". Then, using svnadmin you will load the dumpfile into a project directory created within the Subversion repository. For example:
# Copy the CVS modules into a temporary cvs repository. # This is not absolutely necessary, but it's for safety's sake. $ mkdir ~/newcvsrepo $ mkdir ~/newcvsrepo/CVSROOT # needed by cvs2svn $ cp -r /oldcvsrepo/module ~/newcvsrepo # Create a dumpfile containing the new CVS repository contents $ mkdir ~/svndump; cd ~/svndump $ cvs2svn --dump-only ~/newcvsrepo/module
# Make a directory for the project. $ svn mkdir file:///path/to/svnrepos/projectA -m "Added projectA directory." # Use "svnadmin load" to load the dumpfile. $ cd ~/svndump $ svnadmin --parent-dir projectA load /path/to/svnrepo < cvs2svn-dump
Given a CVS repository with the layout:
/project_a /project_b
cvs2svn will produce a Subversion repository with the following layout:
trunk/ project_a/ ... project_b/ ... tags/ ... branches/ ...
However, you may want your Subversion repository to be laid out like this:
project_a/ trunk/ ... branches/ ... tags/ ... project_b/ trunk/ ... branches/ ... tags/ ...
Currently, cvs2svn does not support converting a repository in this manner (see Issue #86 for details), however, there is a workaround. You can convert your repository one project (or module) at a time and load the individual dumpfiles into your Subversion repository using svnadmin with the --parent-dir switch. See the answer to How can I convert my CVS repository one module at a time? for details.