snipsnap2svn
For the impatient:
[Download snipsnap2svn.xslt](snipsnap2svn.xslt)
[SnipSnap web site](http://snipsnap.org/)
[Subversion web site](http://subversion.tigris.org/)
[snipsnap2svn](snipsnap2svn.xslt) is an
[XSLT](http://www.w3.org/TR/xslt) script that converts
[SnipSnap](http://snipsnap.org/) XML database exports into
[Subversion dumpfiles](http://svn.collab.net/viewvc/*checkout*/svn/trunk/notes/fs_dumprestore.txt),
with change history, so they can be imported into a Subversion repository.
This allows you to use Subversion to examine your snips' change history,
experiment with alternative SnipSnap storage backends, or migrate from
SnipSnap to another CMS, such as [PyBlosxom](http://pyblosxom.bluesock.org/).
Example usage:
$ xsltproc snipsnap2svn.xslt snipsnap_db.xml | \
svnadmin load /path/to/repo
By default, snipsnap2svn uses `/` as the path separator, `.snip` as the
default file extension for snips that don't have one, and `100000` as
the starting revision number in the Subversion dumpfile. (The revision numbers
will be lowered to start at your current revision when Subversion loads them.)
You can change these settings by changing the `xsl:variable` elements after
the `xsl:transform` open tag. For example, you'll need to increase
`BASE-REVISION` if your repository has more than 100000 revisions.
Also, note that snipsnap2svn recreates your snip hierarchy in the root
directory of your repository. To load it into a subdirectory, use the
`--parent-dir` argument to svnadmin load.
snipsnap2svn has been tested against SnipSnap 1.0b2-uttoxeter and
Subversion 1.3.1, but it should work with any compatible versions.
TODO: SnipSnap attachments. They're base64-encoded in SnipSnap's XML dump, but
they need to be converted to binary in the Subversion dump file decoder.
Unfortunately, there are very few working XSLT base64 decoders.
[Mukul Gandhi's](http://gandhimukul.tripod.com/xmlxslt.htm) is close, but it's
recursive, so files above a few KB overflow the stack. :/
snipsnap2svn is copyright 2006 [Ryan Barrett](about), and is
distributed under the [GPL](http://www.gnu.org/licenses/gpl.html).