Transfer history from CVS / PCVS / VSS / ClearCase / StarTeam / MKS to SVN

Good day!

This article is dedicated to one small task - transferring the repository together with the entire history from one version control system to another, or rather, to SVN. We are talking about using the free Importer for SVN utility from Palarion , with which you can migrate from CVS / PCVS / VSS / ClearCase / StarTeam / MKS to SVN without losing the code change log. In my case, it was necessary to transfer projects from Borland StarTeam.

Why was it said no to StarTeam and yes to SVN? At first I thought to skip this paragraph in order to avoid holivarov. But, perhaps, without this, the article would have been deprived, let us say, of a domain of definition. In my case, abandoning StarTeam forced the departure of the person who introduced and administered it. Couple days of unsuccessful attempts made to work under a different service account is a record spawned the idea that the task of restoring backups of the repository will be more used to lshim challenge. Of course, the radius of curvature of the hands could be significantly increased after some time. But we need it, we ask, when is there a free, outrageously easy to install and support SVN? Moreover, I had enough experience using it in previous places of work, and all two and a half developers are in the same room.

One hurdle - it was a pity to lose the history of change. At first they thought to fill in the current versions in SVN, and watch the story in StarTeam, translating it previously into read-only. But as they say, this is not our method. And a short google search brought up the aforementioned Palaion Importer for SVN.



Now directly to the point. We have a repository in CVS / PCVS / VSS / ClearCase / StarTeam / MKS (with passwords and all accesses). It is required to transfer it to a new repository in SVN.

Note 1: Judging by the options in the config, there is the possibility of uploading data to an existing repository, but I did not check it.

General plan of action:


0. Checking system requirements.
1. Download the utility.
2. We configure the general parameters.
3. Set up the SVN section.
4. Configure the VCS source section.
5. Launch the utility.

0. Check system requirements


Of all the system requirements, an installed and configured JRE (since the utility is written in Java) on the machine where the utility will work. Both the source and the receiver must be available from this machine.
In my case, both StarTeam and SVN servers spin on the same machine, incl. for me the choice was obvious.

1. Download the utility


Here is the link "Download" to the left of the main text. Immediately after specifying the name / company / e-mail, downloading will begin. There is no confirmation request for soap, but there is a check for the existence of the address. Then just unpack the zip archive to the target machine.

2. Configure general settings


In the config.properties file:

srcprovider = st
This is the most important thing - the data source. Here is StarTeam.

import_dump_into_svn = yes
You can only create dump file (s) - for this we put no here. For example, if any errors occur precisely at the stage of import into SVN (see the "Identified problems" section).

existing_svnrepos = yes
clear_svn_parent_dir = yes
In principle, using these parameters, you can upload them to an existing repository. I have not tried it. I created a locally new repository and then imported it to the server using a convenient interface.

3. Configure the SVN section


In the config.properties file:

svnimporter_user_name = login
I used my domain (AD) login. But, it seems to me, you can specify any.

svnadmin.executable = c: / Program Files / VisualSVN Server / bin / svnadmin.exe
Yes. I am using VisualSVN. Who does not like it, prescribes the path to another server.

svnadmin.repository_path = D: / SvnRepositories / Repository1
Paradoxically, this is the location of the SVN repository.

svnadmin.parent_dir =.
Folder inside the SVN repository. In this case, the root.

svnadmin.tempdir = c: / temp / svnlocal
Temporary garbage.

svnclient.executable = c: / Program Files / VisualSVN Server / bin / svn.exe
You won’t believe ...

svnadmin.verbose_exec = yes
Detailed information about the process will be written to the log.

There is also a config.autoprops file. It lists MIME types and properties for individual file extensions. I had "factory" settings enough for the ears. To whom it is not enough - it can peep, for example, here .

4. Configure the VCS source section


For each of the supported VCS all in the same config.properties has a separate section. The comments help to understand why.

In the case of StarTeam, specify the connection string (separate folders can also be specified inside the view):
st.url = LOGIN: PWD @ SRV-NAME: 49201 / Project / View
st.tempdir = c: / temp / starteamtemp


Note 2: I tried to use the st parameters .includes.regex / st.excludes.regex, but did not understand the secrets of their format (what RegEx I know, but to what part of the URL it applies, a series of experiments did not give clarity). I tried to write to their forum , but received no response.

5. Launching the utility


Well, here - you can press the red button with sweaty handles. To do this, run svnimporter.jar (the run.bat file has already been carefully prepared for the Windows user, where it is passed to the JVM) and pass 2 parameters to it:
% 1 - command. In our case, it is full. Possible options: list, incr.
% 2 - our config corrected above: config.properties.

Those. something like this:
SET JAVA_OPTS=-Xmx192m
java %JAVA_OPTS% -jar svnimporter.jar full config.properties


Remark 3. Of the commands known to me, there is still a list for checking the correctness of export / import settings.
Remark 4. There is also an incremental dump, but this topic is not covered in this article, although it may be useful to those who want to synchronize two VCS on a regular basis (on a schedule).

Success criterion

After the utility is finished, we look in the history.log log and look for the sacramental line “successfully finished”. If it is not, then look in svnimporter.log for an error and fix it.

Identified Issues:


1. My utility swore that it could not find any Borlando-Startim classes. I threw the starteam80.jar library into the lib folder, which I took from the installation location of my StarTeam Server 2005. Perhaps you just needed to set up the environment variables for Java.

2. At the 3rd run, there were problems when importing to SVN. The utility swore at an invalid UTF-8 character. I don’t know if this utility is curvature or if there was a broken version in my storage. In general, solution options:
  • use st.includes.regex / st.excludes.regex to skip the problem file, but as I wrote above, I was able to understand how they work (see step 4).
  • kill the problem file in the source repository.
  • Create only dump files without importing into SVN (see step 2), fix the broken code in a dump with a hex editor, and fill in dump files with SVN dumps using svnadmin.exe.


Also popular now: