Migrating a blog from Tumblr to Jekyll

I'm done with hosted solutions and have switched by blog to Jekyll

Posted by Tejus Parikh on March 24, 2013

Finding the right platform for a technology blog, especially a technology blog that references code, is a challenge. Platforms like Wordpress are very configurable, but require a lot of maintenance. Hosted platforms remove the maintenance burden at the cost of configuration.

My requirements are straightforward. I want a system that:

Tumblr had a lot of these features, but it failed on customizability and code snippets. Instead I decided to move the whole thing over to Jekyll, hosted on Amazon S3 and distributed by Cloudfront.

The Initial Conversion and Handling a Broken Importer

Jekyll includes a migration for Tumblr. However at the time of this writing (Jekyll 0.12.1), the migration is broken.

Rather than applying the patch, I downgraded the gem to version 0.11.2 to perform the initial import. Once the import was complete, I simply migrated back to the latest release.

Necessary Post Cleanup

The migrator pulled down all the text content. There are two major changes needed. The first is all the files are named with their Tumblr ID, making for awful URLs. The second is that since Tumblr is difficult to use for code, all my recent code was in Gist.

I used a little bit of ruby programming to hurdle these issues.

The code is far from perfect and I could not find an ideal way to handle inserting code snippets that contained XML. Eventually I gave up on the programmatic solution and fixed these files manually.

Hosting

Jekyll is a static site generator. I edit less, write markdown and edit templated markup, but the output of the process are ready to serve resources.

Mostly because I could, I decided to serve by blog thorough Amazon's Cloudfront CDN. This process was trivial using the jekyll-s3 gem.

I did run into one gotcha. Initially, I had my blog configured to use the bucket as the origin. However, none of the sub-directory indexes would resolve. The Amazon static site URL must be used as the Cloudfront origin for this to work properly.

Origin Config

Are the Goals Met?

I am very happy with the setup. Since this is hardly a high traffic site, the cost to host it is mere pennies. The site itself is blazing fast since it uses little else than circa 1995 level web technology.

I also manage this site with Git, allowing for multiple copies and easy versioning. Also, since I am now only editing a little markdown, it's very easy to write new posts on the iPad with IA Writer.

The only drawback is the difficulty in sharing media on the go. For that reason, my personal blog will not be making the transition.

Related Posts:

Tejus Parikh

Tejus is an software developer, now working at large companies. Find out when I write new posts on twitter, via RSS or subscribe to the newsletter: