Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Added migrator to import entries from Serendipity (S9Y) #399

wants to merge 3 commits into from

4 participants


The complete RSS feed of your S9Y installation will contain the full entries of your blog. But you're correct in that the teaser and the extended content of your blog posts will end up together in the markdown files.

Regarding the naming of the markdown files I've updated the pull request to include my changes to that. I somehow forgot about that, sorry.


Thanks, I'll try it


I have used it to migrate my previous blog. It is very useful as it saves a lot of work but do not prevent editing work.


  • You end with all your posts created and filled with content.


  • You have only the intro for every article with "read-more".
  • You lose all comments.

This cons come from the fact that you extract the info from the rss.



Of course, Yes, your're right


@ferochera: You can export a full RSS feed of your blog entries (and not just the abridged version) in the admin backend of your S9Y installation.


Thanks! It's a great work, perhaps I didn't said it loud enough in my previous comment. Sorry for that.

It's been to late for me as I already moved all data. It was a small blog and this gave the opportunity to practise markdown.

But it'll be useful for other s9y migrators ;-)

@parkr parkr referenced this pull request in jekyll/jekyll-import

Jekyll PRs #3


Resubmitted via jekyll/jekyll-import#3

@parkr parkr closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 11, 2011
  1. @joschi

    Added migrator to import entries from Serendipity (S9Y).

    joschi authored
    * Only uses classes from Ruby's standard library, no database required
    * Entries can be exported from
    * Usage: ruby -r './s9y_rss.rb' -e 'Jekyll::S9Y.process("")';
  2. @joschi
Commits on Sep 18, 2011
  1. @joschi
This page is out of date. Refresh to see the latest.
Showing with 49 additions and 0 deletions.
  1. +49 −0 lib/jekyll/migrators/s9y_rss.rb
49 lib/jekyll/migrators/s9y_rss.rb
@@ -0,0 +1,49 @@
+# Migrator to import entries from an Serendipity (S9Y) blog
+# Entries can be exported from
+# Usage:
+# ruby -r './s9y_rss.rb' -e 'Jekyll::S9Y.process("")'
+require 'open-uri'
+require 'rss'
+require 'fileutils'
+require 'yaml'
+module Jekyll
+ module S9Y
+ def self.process(file_name)
+ FileUtils.mkdir_p("_posts")
+ text = ''
+ open(file_name, 'r') { |line| text = }
+ rss = RSS::Parser.parse(text)
+ rss.items.each do |item|
+ post_url ='.*(/archives/.*)')[1]
+ categories = item.categories.collect { |c| c.content }
+ content = item.content_encoded.strip
+ date =
+ slug ='.*/archives/[0-9]+-(.*)\.html')[1]
+ name = "%02d-%02d-%02d-%s.markdown" % [date.year, date.month,,
+ slug]
+ data = {
+ 'layout' => 'post',
+ 'title' => item.title,
+ 'categories' => categories,
+ 'permalink' => post_url,
+ 's9y_link' =>,
+ 'date' =>,
+ }.delete_if { |k,v| v.nil? || v == '' }.to_yaml
+ # Write out the data and content to file
+"_posts/#{name}", "w") do |f|
+ f.puts data
+ f.puts "---"
+ f.puts content
+ end
+ end
+ end
+ end
Something went wrong with that request. Please try again.