📜 ⬆️ ⬇️

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

Good day!

This article is devoted to one small task - the transfer of the repository, along with the whole story, from one version control system to another, or rather, to SVN. It will be a question of using the free Palarion Importer for SVN utility , 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 StarTeam “no” and “yes” SVN said? At first I thought to skip this paragraph in order to avoid holivars. But, perhaps, without this, the article would be deprived, let's say, of definition. In my case, abandoning StarTeam was forced by the departure of the person who introduced and administered it. A couple of days of unsuccessful attempts to get the service to work under a different account gave rise to the idea that the task of restoring repositories from backups would be another big challenge. Of course, the radius of curvature of the hands could be significantly increased after some time. But we need it, it is asked, when there is a free, outrageously easy to install and maintain SVN? Especially since I had plenty of experience using it at previous places of work, and all two and a half developers are in the same room.
')
One obstacle - it was a pity to lose the change history. At first, they thought of uploading the current versions to SVN, and looking at the history in StarTeam, transferring it to read-only in advance. But as they say, this is not our method. And a short google search turned the Palarion Importer for SVN mentioned above higher in the head.



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

Note 1: Judging by the options in the config, it is possible to upload data to an already existing repository, but I did not check it.

General action plan:


0. Check system requirements.
1. Download the utility.
2. Set up general parameters.
3. Configure the SVN section.
4. Configure the VCS source section.
5. Run the utility.

0. Check system requirements


Of all the system requirements, an installed and configured JRE (because the utility is written in Java) on the machine where the utility will run. Both source and receiver must be accessible from this machine.
In my case, the servers and StarTeam, and SVN are spinning on the same machine, t.ch. for me the choice was obvious.

1. Download the utility


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

2. We adjust the general parameters


In the config.properties file:

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

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

existing_svnrepos = yes
clear_svn_parent_dir = yes
In theory, using these parameters, you can upload to an already existing repository. I have not tried. 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 activated 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, 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 SVN repository. In this case, the root.

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

svnclient.executable = c: / Program Files / VisualSVN Server / bin / svn.exe
You will not believe…

svnadmin.verbose_exec = yes
The log will be written detailed information about the process.

There is also a config.autoprops file. There are MIME types and properties for individual file extensions. I had the “factory” settings for my ears. To whom a little - can spy, for example, here .

4. Configure the VCS source section


For each of the supported VCS all in the same config.properties there is a separate section. Kammenty help to understand why.

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

Note 2: I tried to use the parameters of st.includes.regex / st.excludes.regex, but I did not understand the secrets of their format (I know what RegEx is, but to which part of the URL it is used, a series of experiments did not clarify). I tried to write on their forum , but received no answer.

5. Running the utility


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

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


Note 3. Of the commands I know, there is still a list to check the correctness of the export / import settings.
Note 4. There is still an incremental dump, but in this article this topic is not disclosed, although it may be useful to those who want to synchronize two VCS on a regular basis (as scheduled).

Success Criterion

After the utility completes, we look at history.log and look for the sacramental line “successfully finished”. If it is not there, then we look at the svnimporter.log for errors and eliminate it.

Identified problems:


1. My utility swore that it could not find any Borlando-Startimov classes. I dropped 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 environment variables for Java.

2. At the 3rd entry, there were problems when importing into SVN. The utility swore at an invalid UTF-8 character. I don’t know if it’s a curvature or if I’ve got a broken version in my storage. In general, solutions:

Source: https://habr.com/ru/post/140023/


All Articles