I'm currently using s9y for my weblog, but I'm planning to convert to a full featured CMS. Drupal has impressed me so far, but I've got a few hundred entries I want to migrate. Has anyone successfully imported s9y's blog entries/categories/comments to Drupal yet, or any recommendations on how to do so?

Comments

robert castelo’s picture

This section of the handbook might be useful for you:

'Migrating from other software'

http://drupal.org/node/271

I've never heard of S9y, so sorry I can't help you more than that.

------------------------------------------
Drupal Specialists: Consulting, Development & Training

Robert Castelo, CTO
Code Positive
London, United Kingdom
----

peterx’s picture

I found "Serendipity - a PHP Weblog/Blog software" at http://www.s9y.org/. The site features a popup but luckily I am using Firefox.

The site uses Javascript to stop you copying text which delayed me only 5 milliseconds. The site is generated by "coWiki 0.3.4 (http://www.cowiki.org)" and is a good example of a "before" site for my Web Site Repair workshop. Perhaps someone could offer to convert Serendipidy from coWiki to Drupal.

If you have the database layout and sample data then we might be able to help you convert. Is there a database structure described in the Serendipity documentation? Export the layout of the relevant database tables using phpmyadmin. Include a few sample rows from each table. we might be able to translate to an equivalent in Drupal.

http://petermoulding.com/technology/content_management_systems/drupal/

cvk’s picture

That's exactly the s9y I was talking about - and I guess you can imagine now why I want to convert :)

I've found no documentation about the database layout, but here is a overview of the database tables containing relevant data: http://80.237.162.33/dump.html - hope that helps...

Serendipity includes a export feature which dumps the complete database as an single RSS file (with the comments to each article referenced as separate RSS files) - maybe if someone already wrote as RSS import, it's probably easier to use this than to convert the database entries.

Thanks for your help!

Cainan’s picture

This should be a pretty easy conversion

one thing that looks a little disturbing is the username stored
in the author field. if you are the only one who posts entries, then its easy.
if you have multiple authors, this can get a lil more tricky.
what is the user/author table??

Cainan’s picture

Okay. here it is. before you even consider it, BACK UP YOUR DATABASE!

Here are teh caveats:

* you MUST start a fresh drupal install.
install drupal, but do NOT log in. the DB must be pristine.

* assumes that you are using the default config for s9y of serendipity.serendipity_

* since the _comments table doesn't store authorids, when converting to drupal, we will assume all entries are 'not verified'.

Usage:

mysql -u -p < s9y_to_drupal.sql

You can get it here.

http://cainan.rootaction.net/~lestat/files/s9y_to_drupal.sql

cvk’s picture

Thanks for your help! Most of the data is in the database now, but I noticed two problems:

First the easy one: After importing, there is no account with admin privileges.

The next problem seems to be a little more tricky: If there's both a teaser and extended text set for an entry, serendipity stores the teaser in the "body" column and the extended text in the "extended" column. If there's no teaser, the full text is stored in the "body" column. After converting, the extended content is lost. I've updated the dump file to resemble this.

Cainan’s picture

let me look. :)

cvk’s picture

I've just resolved the admin account problem (somehow), fixed a few minor glitches, and I'm gotta take a look at your sql to try to solve the teaser/extended problem now. There seems to be a charset problem, btw. guess, s9y stores latin1, while drupal uses utf-8.

If you wanna take a look at the results:
http://80.237.162.33/drupal/

Cainan’s picture

adding the below line to your template ought to fix the charset problem for you. I know it isn't the elegant solution, but it IS quick.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Check teh .sql file again, what i did was:
if NO extended body, set both body and teaser to the 'body'
otherwise, set teh teaser to teh 'body', and the body to the 'extended'

Hope that produces what you want.

cvk’s picture

I think I finally got it, the only thing I needed to do was to
update node set type="blog", promote=1, format=3
and run a little script that utf8_encodes all entries. A few umlauts are still b0rked, but I can fix that manually.

Only one thing left: Due to the way drupal stores the teasers, an additional update node set body=concat(teaser, body) where body <> "" was necessary to copy the teaser over to the body.

Thanks again for your help, I think I got a working blog now.

Cainan’s picture

Glad i could help!

EnekoAlonso-1’s picture

Hi there!

I have an old blog on s9y (serendipity) with entries from november 2004 to dec 2005 and I would like to migrate those to my drupal blog.
I've tried to get the sql script mentioned here, but the link no longer works.

Does anybody have a copy of that script?

Thanks!

jadestorm’s picture

Hi folk, just wanted to point you at how you can get to the old script. Through the magic of web.archive.org =)

http://web.archive.org/web/*/http://cainan.rootaction.net/~lestat/files/...

or more specifically: http://web.archive.org/web/20060314013345/http://cainan.rootaction.net/~...

rollenc’s picture

I am puzzled for this migrating.
It would be better that there is a instruction as in http://drupal.org/node/271

--
My Joomla site: A B2B Site for Telecommunication Products and Companies

chrisrx’s picture

Can you explain how to use that script properly please. I don't understand how to get it to work.
I'm putting in
mysql -u drupal -p<password> -h drupal.<mysite>.com drupal s9y_to_drupal.sql

and I've also tried
mysql -u drupal -p<password> -h drupal.<mysite>.com < drupal s9y_to_drupal.sql

But I can't figure out what to do

Cainan’s picture

cat s9y_to_drupal.sql | mysql -u drupal -p
-h drupal..com drupal

chrisrx’s picture

Ok I got this working in the end I thought I would just add this for reference to anyone else who is migrating from serendipity.
This script only works with drupal 4.6. I had to use this scrpt with a fresh install of 4.6 and then upgrade to 4.7

dbu’s picture

i found this post most helpful http://vhata.net/blog/2007/03/27/converting-from-serendipity-to-drupal

it tells how to import blog posts into an existing drupal installation, using the defined interface instead of the risks of direct database access.

deminy’s picture

I wrote a script to import Serendipity blogs, comments, categories and tags to Drupal 7. For details, please check https://github.com/deminy/s9y-to-drupal

Suggestions and pull requests are welcome. Thanks