Snipsnap to WordPress Import

I’ve just imported the blog content out of the SnipSnap wiki I’ve been running for almost 3 years. It wasn’t the cleanest process, I’ve got some stray links to dead content, but I’m happy enough with the results. If there’s a better way, I wasn’t patient enough to find it. I’ll look through the rest of the wiki for any pages (non-blog) later and pull that handful in manually if it’s worth it.

Snipsnap outputs RSS, WordPress imports RSS. Sounds easy, but it’s more involved than you may expect. Issues: Snipsnap only outputs the last 10 items, and the RSS it outputs is pre-encoded with some snipsnap specifics. Sadly, there’s no way to change that in configuration, so some java source editing is required.

Grab one of the latest source projects from http://snipforge.org/download/, I used snipsnap-1.0b3-uttoxeter-20060208-src.

I was impatient finding just the right source to change, so I found several relevant places and updated the count from 10 to 10000 to adequately cover the number of posts contained.

Snipsnap source where I changed that number:

  • RecentlySnipChangedFeeder.java
    • List changed = space.getChanged(10);
  • Rssify.java
    • while (iterator.hasNext() && result.size() <= 10)
    • if (list.size() < 10)
  • BlogImpl.java
    • return Rssify.rssify(getPosts(10));
  • SnipImpl.java
    • .getChildrenDateOrder((Snip) Aspects.getThis(), 10)
    • .getChildrenModifiedOrder((Snip) Aspects.getThis(), 10)

Rebuild the Snipsnap project with ant, and install your new app. I exported from my existing snipsnap app, and imported into the new one. Once that completed, I could download and save /snipsnap/exec/rss?type=rss for the full RSS containing all weblog posts.

Now some minor file scrubbing remains. WordPress requires valid XML, and also appears to expect the item/content:encoded element to contain your HTML marked up, and wrapped with CDATA. What instead exists is HTML Encoded, with no CDATA. There are also some Snipsnap inserted images and formatting markup. I manually found/replaced strings with BBEdit, but a series of regular expressions would have worked just as well, and certainly resulted in more geek-points.

All that’s left in the WordPress admin is to load the RSS import screen, select your downloaded RSS, and let it do it’s thing. I raised a few database errors up front, but it then displayed the list of imported snips, and it looks like everything came through correctly.

Remaining issues: The RSS importer assigns the userId to 1, so if that’s not you, you’ll have to update it. Also, the categories are not assigned, so you have to manually address that or insert the needed data for the RSS and the WordPress importer.

I’m going to do this at least once more for other sites, so we’ll see if any major issues come up.

18 thoughts on “Snipsnap to WordPress Import

  1. For the record, this method works rather well, with the exception of some of the blog posts made before SnipSnap updated their magic-name used for the blog posting structure. If you have posts from when that happened, you know what I’m talking about. Sadly, I’m unable to find the reference to it on SnipSnap‘s site, and I don’t think trying to also script that migration inside SnipSnap is worth it. I’ll likely just parse the export xml for the old entries I identified in the index by name.

  2. For the record, this method works rather well, with the exception of some of the blog posts made before SnipSnap updated their magic-name used for the blog posting structure. If you have posts from when that happened, you know what I’m talking about. Sadly, I’m unable to find the reference to it on SnipSnap‘s site, and I don’t think trying to also script that migration inside SnipSnap is worth it. I’ll likely just parse the export xml for the old entries I identified in the index by name.

  3. I want to choose a platoform for Wiki/Blog and I wonder… why did you go from SnipSnap to WordPress?

  4. I want to choose a platoform for Wiki/Blog and I wonder… why did you go from SnipSnap to WordPress?

  5. SnipSnap required more server baby-sitting than I cared for, and I regularly lost content using its filesystem storage when the server hung while content was being served.  I had issues with this whether it was managed with individual Jetty instances or when using Apache Tomcat to serve the war file.  My initial attempts to change to alternate storage methods were not successful, so I stuck with the FS until I found a good replacement.  Creating plugins or custom content was also quite a chore.

    With WordPress, the installation is simple and quick, the performance is good, the impact on the server is small, and the storage in mysql is reliable.  I routinely back up the databases, but haven’t had an issue.  There’s also a larger community around this established product, so between finding plugins and solving issues, I’m very happy.

  6. SnipSnap required more server baby-sitting than I cared for, and I regularly lost content using its filesystem storage when the server hung while content was being served.  I had issues with this whether it was managed with individual Jetty instances or when using Apache Tomcat to serve the war file.  My initial attempts to change to alternate storage methods were not successful, so I stuck with the FS until I found a good replacement.  Creating plugins or custom content was also quite a chore.

    With WordPress, the installation is simple and quick, the performance is good, the impact on the server is small, and the storage in mysql is reliable.  I routinely back up the databases, but haven’t had an issue.  There’s also a larger community around this established product, so between finding plugins and solving issues, I’m very happy.

  7. My site piggybacks on the happy land of nopaper, and I find that since switching to WordPress calls of “Hey, it’s broken!” and “Where did my site go?” have decreased 98%. Calls of “help me change this one little thing because I can’t do it on my own” have dropped over 72%. Ease of use is everything I thought Snipsnap would be when I originally switched and much more.

  8. My site piggybacks on the happy land of nopaper, and I find that since switching to WordPress calls of “Hey, it’s broken!” and “Where did my site go?” have decreased 98%. Calls of “help me change this one little thing because I can’t do it on my own” have dropped over 72%. Ease of use is everything I thought Snipsnap would be when I originally switched and much more.

Leave a Reply

Your email address will not be published.