<?xml version="1.0"?>
<!DOCTYPE content [ <!ENTITY nbsp " "> ]>
<rdf:RDF xml:base="http://snarfed.org/rdf"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/">

<rdf:Description rdf:about="http://snarfed.org">
  <dc:title> snarfed.org  </dc:title>
  <dc:description> draw group stream of consciousness </dc:description>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>
</rdf:Description>

<rdf:Description rdf:about="http://snarfed.org/space/snipsnap2svn">
  <dc:title> snipsnap2svn </dc:title>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:date> 2006-10-06T09:45:00Z </dc:date>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>

  <content>
    <p><a href="http://snipsnap.org/"><img src="/space/snipsnap.png" style="padding-bottom: 15px" /></a>
<a href="http://www.w3.org/TR/xslt"><img src="/space/xsl.png" alt="/space/xsl.png" title="" /></a>
<a href="http://subversion.tigris.org/"><img src="/space/subversion.jpg" alt="/space/subversion.jpg" title="" /></a></p>

<p>For the impatient: <br />
<a href="/space/snipsnap2svn.xslt">Download snipsnap2svn.xslt</a> <br />
<a href="http://snipsnap.org/">SnipSnap web site</a> <br />
<a href="http://subversion.tigris.org/">Subversion web site</a></p>

<p><a href="/space/snipsnap2svn.xslt">snipsnap2svn</a> is an
<a href="http://www.w3.org/TR/xslt">XSLT</a> script that converts
<a href="http://snipsnap.org/">SnipSnap</a> XML database exports into
<a href="http://svn.collab.net/viewvc/*checkout*/svn/trunk/notes/fs_dumprestore.txt">Subversion dumpfiles</a>,
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 <a href="http://pyblosxom.sourceforge.net/">PyBlosxom</a>.</p>

<p>Example usage:</p>

<div class='p-shadow'><pre><code>$ xsltproc snipsnap2svn.xslt snipsnap_db.xml | \
  svnadmin load /path/to/repo
</code></pre></div>

<p><br class='clearing' />By default, snipsnap2svn uses <code>/</code> as the path separator, <code>.snip</code> as the
default file extension for snips that don't have one, and <code>100000</code> 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.)</p>

<p>You can change these settings by changing the <code>xsl:variable</code> elements after
the <code>xsl:transform</code> open tag. For example, you'll need to increase
<code>BASE-REVISION</code> if your repository has more than 100000 revisions.</p>

<p>Also, note that snipsnap2svn recreates your snip hierarchy in the root
directory of your repository. To load it into a subdirectory, use the
<code>--parent-dir</code> argument to svnadmin load.</p>

<p>snipsnap2svn has been tested against SnipSnap 1.0b2-uttoxeter and
Subversion 1.3.1, but it should work with any compatible versions.</p>

<p>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.
<a href="http://gandhimukul.tripod.com/xmlxslt.htm">Mukul Gandhi's</a> is close, but it's
recursive, so files above a few KB overflow the stack. :/</p>

<p>snipsnap2svn is copyright 2006 <a href="/space/about">Ryan Barrett</a>, and is
distributed under the <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.</p>

<p>See also:</p>

<ul>
<li><a href="/space/snipscrape">snipscrape</a></li>
<li><a href="/space/2006-08-23">Migrating from SnipSnap to PyBlosxom</a></li>
<li><a href="http://snipsnap.org/space/xml+issue">Rendering SnipSnap snips with XSLT</a></li>
<li><a href="http://blog.fivesight.com/prb/space/Migrating+Radio+to+SnipSnap">Migrating from Radio to SnipSnap with
XSLT</a></li>
<li><a href="http://snipsnap.org/space/xml+issue">Using XML to structure snips</a></li>
</ul>

  </content>

  <rdf:Seq>

  </rdf:Seq>
</rdf:Description>
</rdf:RDF>
