|
!!Migrating from PVCS to Subversion I 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__ # pcli listversionedfiles # pcli vlog -- Parses the vlog to learn about all revisions, properties, comments, and version labels. The parser is pretty good unless your developers have taken to using a series of dashes in their comments. I suggest running the vlog yourself beforehand, searching for all such comments (see perl below), and modifying them in the PVCS GUI. Look for any lines containing a series of dashes not immediately followed by a "Rev ..." line of text. Simply remove any series of dashes in a comment. # pcli get -- Does a get of all revisions of all files into a temporary directory, see note about disk space requirements. # Creates the dump files while running checksums against the files pulled in step 3 (see config.properties xxx). # Cleans up temporary files and exits (see config.properties "disable_cleanup") !__Line Endings__ Do 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 Space__ __WARNING__: 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). !__Memory__ In 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" to 500m. I didn't have any problem with the heap after that. !__Log Files__ Svn-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 Groups__ Svn-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 Scripts__ __Find comments in vlog that contain dashes__ <code> perl -e 'while(<>){next if $_ !~ m/----/; $x=<>; print "$.\t$x" }' < vlog.txt | grep -v Rev </code> __Assign Version Label to Promotion Group__ <code> 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 </code> __Copy a tag to a branch in Subversion__ <code> svn copy ''svn-path''/tags/svnbranch_Production ''svn-path''/branches/Production </code> <!--ewiki_col_break <!--ewiki_google_scraper <!--ewiki_google_scraper |
|