Serendipity to WordPress – Post import

You may also like...

87 Responses

  1. Brian says:

    I’m trying to install but no matter what version of wordpress I try latest/2.9/2.8 after putting serendipity.php into the import directory it doesn’t show up in admin>import, i’ve tried chmod to 755 etc.

  2. Hannes says:

    Hi Jon,

    installation of the plugin worked fine but when I enter my s9y database information I get the following message:

    Warning: mysql_get_server_info() expects parameter 1 to be resource, boolean given in /home/www/web35/html/wp-includes/wp-db.php on line 1758

    Do you have any hint?

    Best regards,

    • Treeebots says:

      Same problem here… mysql_get_server_info() expects parameter 1 to be resource, , boolean given in /home/oreneta/public_html/margaret/wp-includes/wp-db.php on line 2146

  3. Julian says:

    Unfortunately i can’t find the serendipity installer in the tools / install option. if i put it into the plugins i can activate it but nothing more. no option to actually use it. Help?

  4. Charles Hall says:

    Any idea if this can be easily modified to transfer a Serendipity blog into a networked WordPress installation?



  5. makdeb says:

    Hi, Jon!
    Thanks a lot for your great work. Had to move s9y blog to WordPress, and your script helped very much. Migrated from s9y v1.7 to WP newest. Some errors while importing, but result is that all entries imported fine. Keep doing your good work!

  6. Joseph says:

    Hi Jon,

    I got so excited when I found this…I have over 500 blog posts that I need to import to WordPress. But the link is broken to the repository, when I try this link:

    I get a 403. I think this plugin is exactly what I’m looking for…I’d really appreciate any help getting to it.



  7. abdussamad says:

    Oh, BTW, its now a WordPress plugin. You stick it in wp-content/plugins and activate it before you can do the import.

  8. abdussamad says:

    I’ve updated the plugin to work with the latest version of WordPress. You can download it here:

    The update version also supports nested comments.

  9. rack says:

    How to get the serendipity.php file into WP IMPORT option?

    Using WP 3.3.1 there is no IMPORT directory to put the serendipity.php file into as directed.
    In WP ADMIN for 3.3.1 clicking on IMPORTS gives a list of about a dozen options.
    Serendipity not being one of them.

    Is there any way of getting serendipity.php into that list?
    As there is no import directory in 3.x and higher I am told.

    • Jon says:

      I’ll have to look, they may have changed the method in which imports are done.

      • rack says:

        Thanx! I am at a standstill until i find an answer.

      • rack says:

        Well I am doing it in 2.9 now.
        I have 8500 articles which went well, I have 7500 comments but when I clicked to import comments I got this

        Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 42 bytes) in /home/kick/public_html/kick/wp-includes/wp-db.php on line 958

        not sure what to do?

        • Jon says:

          Ok. That means you ran out or memory (duh) while importing. Check out specifically the first php.ini section and the .htaccess section. If you can get one of the two of those to work, you’re golden. I’d suggest going for something like 64M or maybe even 128M.

          • rack says:

            Thanx! Finding no php.ini file I added the string to .htaccess.
            Do I turncate the DB again, or just run it and it will know only to do the comments?
            Thanks again, rack.

          • rack says:

            That list of UPDATE commands in the readme file has me stumped.
            I assume I do that in phpadmin under structure? But I don’t know how to do it.
            Or are those SSH commands? Maybe if you could take one of them and walk me through I can figure out the rest? And as the import went smoothly with posts, users and categories, with everything seeming to work okay, are those things necessary?

            • Jon says:

              Updates can be run in PHPMyAdmin. Just goto your wordpress database and press SQL tab.

              • rack says:

                Sorry this is something I have never dealt with before.

                The first on on the list, WP_COMMENTS is the most complicated to me.

                29 #* UPDATE `wp_comments` as a SET a.`comment_post_ID`= (SELECT b.`menu_order` FROM `wp_posts` as b WHERE a.`comment_post_ID`= b.`ID`);

                I pick the WP_comment table then click the SQL tab on top.

                In a window that says RUN SQL QUERY I see

                SELECT * FROM `wp_comments` WHERE 1

                I see the field options on the right with a move << button. But not sure what to do.


                Am I to just PASTE everything after the UPDATE into the window and GO?
                Or just some of it?

                Thanx for bearing with me on this…

                • John says:

                  rack – this appears to all be way over your head, and unfortunately, Jon’s job is limiting his ability to respond in a timely fashion. At this point, my suggestion is that you try out abdussamad’s solution. If that doesn’t work, his site mentions he offers support.

  10. rack says:

    Sorry, kick is the NAME of the site, not the URL.

  11. rack says:

    The last entries before I came by from October showed Bas having a problem with no wp-admin/import/ directory available. After installing wp 3.3.1 I have the same issue.

    I also read in another forum, I think it was Simone, that one has to use wp 2.9 or earlier or the /import/ directory does not show up. Then upgrade later.

    When I access tools/import from admin there is a list of possibilities, serendipity not among them.

    Not sure what to do…


    • John says:

      rack – I just went back through your comments and removed your URL, as you keep putting in “kick” which is obviously not a valid site. You might want to enter the correct URL for your next comment. Additionally, try using “Reply to this comment” so that your messages are all part of the same thread.

  12. rack says:

    okay Thanx… Its a scary thing! :)

  13. rack says:

    So Simones upgrade will take care of sub categories. Looking at the serendipity.php file I downloaded it says version 1.5. It also says tested on Serendipity 1.5.x to WP version 2.9.2.
    My Serendipity is 1.5.1 and the WP I downloaded is 3.3.1. Shall I proceed? :)

    Thanx again…

    • Jon says:

      Should be OK. I dont think much has changed in S9y in the last few years and the WP side should be ok as long as it doesn’t complain right off the bat

      • rack says:

        The last entries before I came by from October showed Bas having a problem with no wp-admin/import/ directory available. After installing wp 3.3.1 I have the same issue.

        I also read in another forum, I think it was Simone, that one has to use wp 2.9 or earlier or the /import/ directory does not show up. Then upgrade later.

        When I access tools/import from admin there is a list of possibilities, serendipity not among them.

        Not sure what to do…


  14. rack says:

    Before I try this 2 questions please…
    Do I need to install a 2x WP version to get this to work?
    Does NESTED categories mean SUB categories or something else?

    • Jon says:

      nope, only one copy of wordpress. Nested categories mean categories under categories. Like on the left side of my blog you see that Arduino is a subcategory of Hardware is a subcategory of tech.

  15. rack says:

    I have serendipity installed in the root.
    I would assume I install WP into /wp to work on while serendipity runs, and then worry about changing it over later?

    • Jon says:

      Yes, if you’re limited to one domain (And no subs). Using /wp/ is probably the best. You’ll probably have a wp setting or two to fix afterwards, but thats easy enough.

  16. rack says:

    Checking to see if this issue is still alive.
    I intend to make the move this week sometime.
    My first question is should I install WP 2.X or does it work with 3.3.1

    My blog has 8000 articles.
    I have a Godaddy dedicated server with newest PHP. SCP and Putty root
    I printed the readme.
    The section of DB commands overwhelms me.
    I am sure I will have to get back to yall on that. :)

    Thanx, Rack

  17. rack says:

    Hey! I am soon to give a move from serendipity to WP a try. I have 9000 articles and a dedicated server and am about a C+ in all this.Maybe a C-. :) I was checking to see if you were still around in case I get in trouble.
    I think my first question is how best to keep Serendipity up while I work on moving it and setting up WP? Thanks Rack.

  18. bas says:


    the following rules:
    # Copy included serendipity.php to /wordpress/wp-admin/import/
    # Login to WordPress Admin Interface
    # Goto Tools > Import

    I cannot do? I use wp 3.21 but don’t see the serendipity import under the Import

    do you have a solution?

    • Jon says:

      Odd. It is showing up for me. Try running ” ls /wordpress/wp-admin/import/ ” and making sure the file is in there. Also try ” chmod 755 /wordpress/wp-admin/import/serendipity.php “. Lastly you could have an issue with cacheing? Try restarting your webserver, if you have control of that.

  19. joho says:

    After having renamed my WordPress user to fooDoo, and re-truncating all tables mentioned in readme.txt, I managed to get it work, apart from the last part (comments), where I got this error:

    Warning: array_merge(): Argument #1 is not an array in /home/html/ on line 1370
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1]
    UPDATE `wp_comments` SET `comment_content` = ”, `comment_author` = ”, `comment_author_email` = ”, `comment_approved` = ‘1’, `comment_author_url` = ”, `comment_date_gmt` = ‘2011-02-15 22:59:36’ WHERE

    Done! 223 comments imported.

  20. One Eye Pied says:

    I tried it on a local installation and it worked fine.
    Is there a way to also import the media from serendipity ?

    • Jon says:

      I just moved the old media (/uploads/) directory from S9y to the WordPress install (/wp-content/uploads) and added a URL rewrite rule.

      #Copied S9y’s /uploads/ dir contents to /wp-content/uploads/ for this one
      RewriteRule ^uploads/(.*)$ /wp-content/uploads/$1 [R=301,L]

      (Per )

      I never bothered to update all the old posts with new img url’s, but they still work because of this rewrite.

  21. cruiser607 says:

    Worked fine for me! Thank you!

  22. Sandy says:

    Hi. I’m horrible at this, but I got to the point in your instructions where you say to put the file serendipity.php in the folder “import”. That folder does not exist. Am I supposed to create it? I did create one and dropped the file in there but when I log into WP’s admin area, it just shows some of the php code and not a link for me to click on. Can you please tell me what I have done wrong? Thanks.

  23. Robin says:

    I imported categories, users fine but posts gave me the Fatal Error: Call to a member function _real_escape() /path/to/html/wp-includes/wp-db.php on line 849

    I’m running the latest WordPress. Could that be the problem?


  24. PerfectCr says:

    Figured it out!!! Apparently, you cannot have the same user name on WP as you did in S9Y nor the same email. I setup a new user in WP, logged in, and deleted the other user and the import completed! Yahoo!!

    • PerfectCr says:

      Sorry to spam your blog :( “One more thing”…

      I was able to run most of the SQL commands without issue, expect the below two SQL queries from your readme returned this error: #1062 – Duplicate entry ‘0’ for key ‘PRIMARY’

      UPDATE `wp_comments` as a SET a.`comment_post_ID`= (SELECT b.`menu_order` FROM `wp_posts` as b WHERE a.`comment_post_ID`= b.`ID`);

      UPDATE `wp_posts` SET `ID`=`menu_order`, `guid`=CONCAT(“http://MYURL.COM/?p=”,`menu_order`), `menu_order`=null;

      Once I get this all figured out I am going to delete the WP install and start over and do it right! :)

      • Steve says:

        @PerfectCr did you ever figure out why you were getting an error message on this:

        UPDATE `wp_posts` SET `ID`=`menu_order`, `guid`=CONCAT(“http://MYURL.COM/?p=”,`menu_order`), `menu_order`=null;

        I am having the same problem and am wondering if this is related to an issue I’m having with comments. All of the comments have them have been transferred to the WP database, each post shows the proper number of comments, but when you click on the post no comments appear.


        • Jon says:

          That specific line updates the post ID’s to the “old” ID numbers. If that failed (but the comment line before didn’t), then your comments have been moved over to the old numbers and your post haven’t.

          Try running this:
          SELECT count(distinct(id)),count(id),count(distinct(menu_order)),count(menu_order) FROM `wp_posts` WHERE 1;

          It should return 4 numbers, all of them should be the same.

          If I’m reading it right “Duplicate entry ’0′ for key ‘PRIMARY’” means that one or more of the posts have their “menu_order” column – that which I use for the old post numbers – set to zero. If you’ve tried to run the line you pasted more than once – that is expected because it sets that field to NULL (or 0 in this case).

          • PerfectCr says:

            So basically, it’s not a big deal? I ignored it and started working on my site and everything appears fine. The only thing that big translate well were Tags, which I dont really care about anyway. :) THANK YOU again!

            • Jon says:

              Well that line is important, but if your post id’s are the same… then it probably failed out on a single record (which probably isn’t a big loss).

              Pull up one of your old posts. the S9y URL will be something like /archives/123-post-name-here.html

              Now goto WP /?p=123 — If the post is the same before and after – you’re good to go (I find generally the most recent posts are the most likely to be “out of sync”). Also check if your comments on one of the S9y posts show up on the right WP post. If so… they you’re good to go.

              • PerfectCr says:

                Ok, I’ll dig through again and see what I can find. At first glance everything looked like it came over normal. :)

              • Sandy says:

                Hi. What’s the solution if the count is off and they’re not the same? Should I scrap the database and start over again? Thanks.

    • silvester says:

      awesome! your comment helped me after nearly 2 hours of fiddling around with several solutions. thanks!

  25. PerfectCr says:

    FYI I replaced “” above instead of putting my actual domain there. Wanted to say that in case there was any confusion. Thx!

  26. PerfectCr says:

    Maybe I am a total noob, but where do I put my old S9Y sql backup file? I have my new db setup for WordPress. I backed my old S9Y db about a year ago and now want to import it. So I guess I don’t know where to begin. :( Thanks for any help or guidance you can provide!

    • Jon says:

      You’ll need to restore the backup file into MySQL. Once it is life in MySQL, you can use the wordpress import tool to point at that database you just restored.

      • PerfectCr says:

        Thanks for your help on Twitter! I’ve loaded the S9Y DB into it’s own database via Bigdump. It’s on the same server but in a different DB so as not to mix WP and S9Y. (should I have imported the S9Y SQL backup into the same DB as WordPress?) All fields are filled in properly and unfortunately nothing happens. Just says 0 items imported on every page. :( I don’t know what else to do. I feel like I am so close, and yet so far. Pic — >

        • Jon says:

          Not the same DB. Different DB’s for S9y and WP is correct. I’m curious is to how you are getting zero.

          Go into PHPmyAdmin or similar, get a SQL window open & run the following:

          use $DATABASE$;
          SELECT categoryid, category_name FROM $PREFIX$_category

          Replace $DATABASE$ and $PREFIX$ with the values you used from the import step (“Serendipity Database Name” and “Serendipity Table prefix (if any):” respectively).

          If you get no results, then you’ve got the wrong information. If you do get data out, then… we’ve got other problems.

          • PerfectCr says:

            That worked…..!!! (was missing the Prefix Table, sorry) to a point…Imported categories, then on the second page (importing users) I was hit with the following error:

            Catchable fatal error: Object of class WP_Error could not be converted to string in /home/perfectcr/ on line 2772

            Sorry to be a pest, I am sure you are ready to kill me. I’ll give you a huge shout out on my new site once this is all sorted I promise. Thank you again!

            • joho says:

              I got the exact same error (save one line):

              Catchable fatal error: Object of class WP_Error could not be converted to string in /home/html/ on line 2773

  27. Mark says:

    I am in the same boat as you were, and I love hearing that you were able to successfully move from Serendipity to WordPress – gives me hope! I started my site with Serendipity a couple of years ago, but over time I have grown tired of dealing with annoying work-arounds and other things (along with the non-working autosave you mentioned), so with WordPress 3.0 now released (I’ve been reading about it for quite awhile, including it’s absorption of WordPress MU), I figured I’d test it out and see if I could make the switch.

    I’m really glad to have found your work, since I’m not TOO technical of a guy. I have some questions, though:

    (I know that this was not created for WordPress 3.0, but I am hoping to discover that my problems are my error, so I don’t have to install a lower version and then upgrade.)

    1. I attempted to follow “Truncate (remove) all records from: `wp_posts`, `wp_postmeta`, `wp_term_relationship`, `wp_term_taxonomy`” but I received an error each time that told me removing all columns was not allowed and that I needed to simply drop the entire section. My mistake in misunderstanding the directions, or a WordPress version difference?

    2. After a few attempts, I figured I’d try and sidestep it, JUST to see if it might work. I was thrilled to see Categories import, and then Users, however, upon reaching the import for posts, I received this error… “Fatal error: Call to undefined function: array_walk_recursive() in /ROOT/wpTest/wp-admin/import/serendipity.php on line 419”

    I really hope to find an answer to these problems, so that I can move on to testing layout and design, and I appreciate it.. in advance.

    • Mark says:

      Ah, I’m a bit of a boob. I noticed that it HAD been tested for WordPress 3, though I am currently running Serendipity 1.5.3, not the tested 1.5.2.

      Also, I have since discovered (another D’oh! on my part) the Empty option in the database, yet the error still occurs on import.

      • Jon says:

        #1 – Sorry, I shall have to find the proper commands and clarify the instructions. By “Truncate” I meant “Delete all records”. All except for default category in `wp_terms`. You _shouldn’t_ have any records in any of these tables if you just installed WordPress – but I’ve seen it create a record in `wp_posts` for the auto-draft plugin on the dashboard.

        So in case that ins’t clear enough, delete just the data – not the actually structure of the tables. If you did modify the table layout, your fastest option will just be to nuke the install and redo it.

        #2 – array_walk_recursive() is a function from PHP 5. My guess would be your running PHP 4? Check what version.

        #3 – I’m fairly confident you’ll be fine on anything 1.5.X, probably back farther. The database layout in Serendipity hasn’t change much in the last few versions (that I’ve seen).


        • Mark says:

          Thanks for the response :)

          1. No, you did just fine – my error was due to a lack of knowledge. Pretty much, I just didn’t know what I was doing ;). That’s how we learn, though, and I’ve figured out how to empty the tables (sans the one you suggest I don’t).

          2. I’ve had issues getting WordPress to install on PHP 5, before, so I had it on 4.1 before. I just did a fresh WordPress install using PHP 5, though my Serendipity DB is on PHP 4.1. I still receive the error, so in the serendipity.php file I commented out rows 418-420 to erase the if statement that function was attached to – and it all worked like a charm!

          Thank you very much! I never quite imagined I’d be leaving Serendipity (as much as I’d enjoyed working with, and recommended, WordPress for others), but this is going to be a good thing :)

          • Jon says:

            #1 – Awesome!

            #2 – Ok, that would explain why the error was there. The lines around that array_walk_recursive() are for S9y Tags, so if you didn’t have any tags (S9y supported tags?!) – you wont have lost anything.

            Glad to hear it all worked out. I look forward to see how your migration work out!

  1. 2010-06-11

    […] This post was mentioned on Twitter by Jon, John. John said: RT @ShakataGaNai: [Blog] Serendipity to WordPress – Post import […]

  2. 2010-06-14

    […] the second most important thing to for a S9Y to WordPress migration, after you import the posts, is to make sure as many of the old links work as possible.  It doesn’t actually require all […]

  3. 2010-06-16

    […] Update 2: Jon reports that he’s improved on Carsten’s 1.3 version, and has released Version 1.4! […]

  4. 2010-06-17

    […] Zwischenzeitlich gibt es eine neue Version, die 1.4 von Jon… (ich habe sie selbst nicht […]

  5. 2010-06-17

    […] und neu veröffentlicht wird. “Meine” Version war die 1.3 und nach einiger Zeit gibt es nun die Version 1.4 – und natürlich nicht von […]

  6. 2010-07-28

    Probleme 2.0…

    Momentan kämpfe ich an mehreren Fronten mit den Tücken des Internets. Grazr hat wohl seinen Dienst eingestellt. Seit Jahr und Tag nutze ich diesen Dienst, um relativ komfortabel auf meiner privaten Seite den Feed dieser Seiten zu präsentieren. Jetzt…

  7. 2010-08-12

    […] around for a while and has been patched/modified by various people. Luckily I found version 1.4, which got updated very recently (June 2010). For some reason it didn’t work for me when I […]

  8. 2010-08-13

    […] Google-fu, I ended up at  Jon there had taken an earlier version of the importer and updated it to version 1.4. Just let me say Jon was extremely helpful.  I bothered him on Twitter for well over a week as […]

  9. 2010-10-14

    […] gehts an den eigentlichen Import der S9Y Daten. Der Serendipity Importer von Snowulf hat hier die Arbeit für mich erledigt. Das README ist essentiell und sollte Schritt für Schritt […]

  10. 2010-10-27

    […] to this article for other useful migration tips. This entry was posted in Software, SysAdmin and tagged s9y […]

  11. 2010-11-26

    […] einer Version die erst Ende Oktober aktualisiert wurde. Zwischensationen meiner Suche waren snowulf und […]

  12. 2010-11-29

    […] should have posted this sooner, but I forgot. My Serendipity to WordPress post importer (v1.4) has been upgraded! Simone Tellini took it (in the spirit of which this software was originally […]

  13. 2010-12-19

    […] weitesgehend verlustfrei zu übertragen. Grundsätzlich Hilfe bot das Plugin, welches ich bei Snowulf via Dobschat gefunden […]

  14. 2011-02-15

    […] Serendipity to WordPress – Post import This entry was posted in Site, WordPress and tagged converter, php. Bookmark the permalink. ← Det är då en FÖRDJÄVLA VÄRDELÖS Försäkringskassa vi skall ha i det här landet. WTF! […]

  15. 2011-06-21

    […] to Snowulf’s script and post migration rewrite rules the migration has been mostly hassle-free. Just the media gallery […]

  16. 2011-10-14

    […] a major hassle.  That was the “sign” for me to go ahead with it, and, thankfully, I found a way.  I would love to thank the countless blogs, forums, and tutorials I made use of during this […]

  17. 2012-02-16

    […] originally found it at Jon Davis’ site. But I have modified the script to work with the latest version of WordPress and also created […]

  18. 2012-09-11

    […] to offer a commercial s9y migration service) for serendipity blogs (comes from a blog article on and his svn, issue for update). It has the possibility to read from the serendipity database all […]

  19. 2012-12-18

    […] the import script from Snowulf. Make sure you grab the latest version (1.5) and the readme […]

  20. 2013-01-13

    […] major hassle.  That was the “sign” for me to go ahead with it, and, thankfully, I found a way.  I would love to thank the countless blogs, forums, and tutorials I made use of during this […]

Leave your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: