Using cvs2svn to migrate your repository from CVS to Subversion

This week I migrated our codebase from CVS to Subversion!

I'd previously downloaded the Tigris cvs2svn migration tool onto my build server, read the documentation and performed a test run of the migration last week so I was pretty confident that I would have no problems.

These are the steps that I took to perform the migration:
Notes: For simplicity I'll assume that your CVS repository root is /cvs and your Subversion directory is /svn. The cvs2svn tool creates a new Subversion repository when you run the cvs2svn migration tool.

  • Log in to the build server (a Debian Linux box) as root

  • Change directory to /cvs and find the name of the module you want to migrate to a Subversion repository, I'll use the module old in my example.

  • Choose a suitable name for your new Subversion repository (it doesn't have to be the same name as the CVS module) I'll use new in my example.

  • Run the following command, (it's best to redirect it's output to a log file to so you can check for errors at the end):

    cvs2svn -s /svn/new /cvs/old
This operation may take a while if the CVS repository is large, our migrated repository took about 30 minutes to migrate and resulted in about 3,500 revisions. I had no problems in the area of branches or tags but this is one issue that has cropped up when I migrated another repository over. You need to use the --force-tag and --force-branch options to specify how to deal with any problematic tags.

I performed the migration as the root user to ensure that we wouldn't have any problems with file permissions when reading or writing files, but we now need to change the permissions of the newly created Subversion repository to ensure that Apache has access to the files:

chown -R www-data:www-data /svn/new

Your new repository will now be available in the same way that you access your other Subversion repositories, just remember to use your newly migrated repository name!

Technorati Tags: , , , , , ,

No comments: