Subversion Migration Tools

Surya Suravarapu
3 min readJun 16, 2009

--

If you are planning to migrate existing repositories (on other SCMs) to Subversion here are a couple of open source migration tools that I found useful:

  • Cvs2svn: As the name indicates migrates CVS repositories to SVN.
  • Importer for SVN: This tool works on a wide variety of version control systems.

cvs2svn

The tool claims that the main design goals are robustness and 100% data preservation. My experience tend to confirm that claim, and also in agreement with the following description

cvs2svn infers what happened in the history of your CVS repository and replicates that history as accurately as possible in the target SCM. All revisions, branches, tags, log messages, author names, and commit dates are converted. cvs2svn deduces what CVS modifications were made at the same time, and outputs these modifications grouped together as changesets in the target SCM. cvs2svn also deals with many CVS quirks and is highly configurable.

As far as the setup goes:

  • download cvs2svn tar from tigris.org
  • if CVS and SVN are on different machines, copy the CVS data onto the target machine where SVN is installed
  • make sure python is there on the classpath
  • run cvs2svn. Here there are lot of command line options and well documented too. Example:
    [sourcecode lang=”bash”]
    python cvs2svn — svnrepos /svn/repo/path — fs-type=fsfs \
    — encoding=utf_8 — fallback-encoding=windows-1252 \
    — default-eol=CRLF — cvs-revnums /path/to/cvsdata
    [/sourcecode]

Make sure you read up about the end-of-line translation before migrating. The process could take hours to days depending on the amount of data you are migrating. You could actually narrow down the amount of data that you want to convert by specifying something like trunk only option at the command line.

Importer for SVN

This tool can import from wide variety of version conrol systems, like — CVS, PVCS, VSS, Clearcase, MKS, StarTeam. Used this one for migrating a PVCS repository.

Setup and running this is a trivial. There is some decent documentation available on the site. Steps wise:

  • download and extract the binary archive.
  • edit config.properties specifying SVN details and the details about the source repository. The file is commented well about what each of the properties mean. (One issue I had with log.dateformat property, changed the date format)
  • run like
    [sourcecode lang=”bash”]
    run full config.properties
    [/sourcecode]

Again, based on the amount of data the process is going to take hours to days. The conversion happens in three steps. First one is it reads the metadata of the source repository and generates an SVN model. Here it determines how many commits, revisions are needed and the file paths each of those commits are happening, etc. Second step is to checkout the data for each of the revisions of the source repository (you can constrain it to use only the most recent revision if you don’t need the history). The data that is checkout is written out in SVN dump format. The last step, loading the dumps into the target SVN repository. There are couple options here for the third step: the tool can provide you the dumps and you can manually load the dumps OR if you have access to the target machine from the process you may configure the tool to load it for you.

The only complain that I have with this tool is that there is no easy way to tell what percentage of the migration is complete. However, you can make a decent determination by looking at the current dump file and the process log file (svnimporter).

--

--

Surya Suravarapu

Areas of expertise: product, strategy, and technology | Mode: Learn, write/apply, and learn (in a loop) | Writes here: https://suryas.org