|
Migrating from PVCS to SubversionI found myself needing to migrate 17 years worth of a corporation's PVCS repositories to Subversion (svn). There is an excellent and free tool at http://www.polarion.com/products/svn/svn_importer The included documentation is good, but not great. Searching the web for more answers did not turn up much. So, I'm sharing my notes below for the next lucky soul. Maybe, when the motivation strikes, I'll write up a "How To".
Svn-Importer Executes in Phases
Line EndingsDo the conversion on the same platform that your PVCS repository is hosted on. If your PVCS projects are hosted on a unix platform, then execute pcli, svn-importer, and svnadmin on unix. They don't all have to be on the same machine, just the same flavor of OS. While all these tools are cross platform, that does not mean you should do the conversion across platforms. Once you have the final subversion repository, you may move that to wherever you like.
Disk SpaceWARNING: This process needs a lot of disk space, two to three times the size of your PVCS repository. PVCS stores your revisions as deltas, but svn-importer expandes them all out to full size during the "pcli get" phase. These temporary, full-sized, revisions stay until the dump files are complete. Even though svn-importer places deltas in the dump files, they'll take up about as much disk as your original PVCS repository. For example, I had one versioned file in PVCS containing over 500 revisions adding up to 4Gb with deltas. Svn-importer needed 9Gb to get the revisions out of PVCS plus 4Gb to generate the dump file. After loading the dump file into subversion, the result of this single file was 3.5Gb (Subversion's delta algorithm is superior to PVCS).
MemoryIn phase 2, svn-importer parses the vlog completely in the java heap. A large project with a lot of revisions may cause the heap to overflow. I modified the "JAVA_OPTS=-Xmx100m" in run.sh to 500m. I didn't have any problem with the heap after that.
Log FilesSvn-Importer does not manage to write to it's log file if there is an error. I suggest capturing the output of the command using redirection. Also, use the property "disable_cleanup=yes" while you troubleshoot the conversion process. You may have to run the pcli commands (without the -q) yourself to find out what caused svn-importer to stop. The pcli error messages are not captured by svn-importer anywhere.
Promotion GroupsSvn-Importer does not transfer PVCS Promotion Group information. Instead, recursively assign version labels to match the promotion groups. Svn-Importer will create tags for these version labels. Then, in subversion, you can switch these tags into branches.
Some Helpful Shell ScriptsFind comments in vlog that contain dashes
perl -e 'while(<>){next if $_ !~ m/----/; $x=<>; print "$.\t$x" }' < vlog.txt | grep -v Rev
Assign Version Label to Promotion Group
for pgroup in Development-1 Development-2 Integration UAT Production do plabel=$(echo $pgroup | sed 's/-//g') pcli run -y Label -pr''project_name'' -v"svnbranch_$plabel" -r"$pgroup" -z / done
Copy a tag to a branch in Subversion
svn copy ''svn-path''/tags/svnbranch_Production ''svn-path''/branches/Production
Send Email When Process Completes
while pgrep -P ''pid'' > /dev/null do sleep 60 done echo "done" | mail -s"svn-importer" ''sms.address.of.your.phone''
|
![]()
|
|