Goodbye Posterous – a migration story
Many of you know (or should know, if you have anything still on Posterous!) that Posterous is shutting its doors following its acquisition by Twitter. I was one of the first Posterous users in 2008, and they even gave me many more blogs than were usually allowed on the service at the time. Heady days, those.
One by one I have been moving blogs to the open-source static blog software, Octopress, which I’ve been hosting on Heroku instances. However, now that Posterous is shutting down, I need to move the last few off, so I’m writing up this post to help anyone else that wants to do the same. Sure you can use their export tool to get a tarball of your stuff, but if you are lazy like me, and just want to get stuff over to Octopress, look no further than this ruby script.
$ gem install posterous
Log into Posterous, go to the api page and get an API key by clicking on “view token”.
You need to know then name of your blog, the username and password, and the API key. Then run:
$ ruby posterous-export.rb username password apikey
I had to patch the Posterous gem to get things working. Otherwise I got this error:
/Users/dan/.rvm/gems/ruby-1.9.3-p374/gems/ethon-0.5.12/lib/ethon/easy.rb:234:in `block in set_attributes': The option: username is invalid. (Ethon::Errors::InvalidOption) Please try userpwd instead of username.
Running the script gets you a file layout on disk including images and HTML-formatted post files, ready for use by Jekyll/Octopress.
To get the new Octopress blog running, just clone the repo and copy the images/ and _posts directories under the octopress/source directory.
I’ll do another post probably about working with/customizing Octopress so I won’t go into configuring Octopress here. Presumably the API shuts down on April 30, so don’t wait too long!