|
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 SpaceThis process needs a lot of disk space, three to six times the size of your PVCS repository. Because:
If your PVCS repository is 5Gb, you'll need 30Gb for the conversion. Don't skimp on this. It's not worth the headache. In fact, double it just to be safe. Beg, borrow, steal the space. Bribe your unix and storage admins if you have to. For example, I had one versioned file in PVCS containing over 500 revisions in a 1Gb compressed delta. During import, PVCS created 4Gb of the "?.?.?u" files. Svn-importer needed 4Gb to get the revisions out of PVCS plus 1Gb to generate the dump file. After loading the dump file into subversion, the result of this single file was 1Gb. (1+4+4+1+1=11 ~ eleven times the disk space).
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. I've heard of some people needing up to 64Gb of memory (see links near the bottom of this page).
Log FilesSvn-Importer does not manage to write to it's log file. 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, use pcli, before migrating, to recursively assign version labels to match the promotion groups (see script below). Svn-Importer will create tags for these version labels. Then, in subversion, you can switch these tags into branches (example below). Fixed to automatically create tags for promotion groups, see update below.
PVCS Attributes vs. SVN PropertiesThe config setting "pvcs.import_attributes=yes" only partially works. The importer creates the properties for svn:keywords and svn:eol-style, only, which is probably enough. However, it doesn't seem to know about the $Header$ keyword. The properties are added to the first revision only. Later revisions, tags, and branches do not get these properties. As such, this feature is virtually worthless. The suggestion in the comments to use auto-props won't help, either, because there are always exceptions to such generic actions. Fixed to place properties on all revisions of a file and include the $Header$ keyword, see update below.
One-Shot vs. IncrementalThe config setting "use_file_copy=yes" will only allow for one-shot conversion. You cannot perform incremental updates afterwards. For incremental flexibility:
An incremental execution takes just as long as a full because in both cases, svn-importer performs a "pcli get" of all revisions of all files, regardless if they are included in the incremental or not. I'm certain this is a bug. I have one repository that takes 32 hours for svn-importer to scan, making it impossible to run a daily incremental update. Fixed to pre-fetch only the files needed for the incremental portion, see update below.
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''
Update: Bugs FixedI managed to get hold of the source code for svn-importer and modify it to fix some of the issues I report above. You can download my modifications at http://kitzkikz.com/files/svn-importer-pvcs-mods.zip , however you're on your own when it comes to implementing them. Use at your own risk.
Other Useful Link(s)
|
|
|