Many months of realisation and growing frustration with Jroller's seemingly permanent state of server atrophy have led me to re-create Skip The Budgie elsewhere. You may recall that I purchased skipthebudgie.org
just before Christmas
, or rather it was purchased for me. I have rebuilt this blog over there, based on the rather wonderful PHP Content Management System, Drupal
and have finally found a way to export ALL MY POSTS from here to there!
The biggest problem is how to obtain all your entries. Back in November I ask Matthew Schmidt over at Javalobby if it is possible to give me some sort of SQL dump from the Jroller database, my thinking being that sql to sql would be easier. Boy am I wrong. Apart from the disastrous upgrade over Christmas that's made using Jroller even more of a chore, I have had intermittent mails telling me that he'll look at it today, he'll look at it today. So I start to look for another solution.
Jroller gives you an RSS feed
for your site, which would be perfect, but it only gives you a limited number of entries. The resulting xml file can be used to generate SQL insert statements to import the posts into the new database. Now I want the whole site, so this just isn't good enough and I realise I will have to write my own RSS page.
I find someone who has done it before, and you can see our conversation there
. He points me towards the Roller source repository
, and particularly export_rss.vm, which I think is how Roller's own rss feed is generated.
A bit more research leads me to This Post
about rss feeds that include comments for Roller. Although the links didn't work I knew I was onto something and emailed the author, who got back to me almost within the hour, attaching his rss page code, which I combined with the export_rss.vm to produce my own rss page
(saved as css file coz Jroller won't let me save xml). Thank you Richard Osbaldeston! You saved me a LOT of trouble.
The bit of code I was after was this, which is parsed (is that the word?) by Roller to generate up to 1000 entries of rss. I only need about 500 but it doesn't really matter what number I put in:
#set( $xmap = $pageModel.getRecentWeblogEntries( 1000, "nil" ) )
#foreach( $day in $xmap.keySet() )
#set( $recentEntries = $xmap.get($day) )
#foreach ($entry in $recentEntries)
#if ( $pageModel.getWeblogEntry() )
#set( $entry = $pageModel.getWeblogEntry() )
#end
#if( $entry )
#set( $day = $entry.pubTime )
#set( $textcontent = $entry.text)
#set( $comments = $entry.comments )
#end
In order to run it properly to create my xml file I use my new rss code to completely replace the _decorator template. Accessing Skip The Budgie's homepage throws up an rss page, which I save and then quickly put everything back to normal.
This done, it's all up to my sql-java geek friends to turn my xml feed into INSERT statements for the Drupal database and I'm off again! We even manage to keep the comment information intact.
A bit of tidying up is required, now we have added 400-odd posts and comments we need to update the ID numbers that the database counts from, as it's still stuck on whatever it was at the beginning. This is done in the 'sequences' table, we just change the 'nid' (node ID) and 'cid' (comment ID) fields to be numbers higher than the last post we added.