ihashacks

i dunno

Obligatory WordPress to Octopress Post

Octopress seems to be the trendy blogging platform these days, but what the hell, why not? Lots of people have posts outlining reasons why. I figure that topic has been beaten to hell, so I thought it might be useful instead to share some of the things I did to make this a smooth transition and share resources that helped along the way.

Converting Posts

There are two routes one can take when migrating a WordPress blog:

  1. SQL database
  2. Export XML

My WP blog was hosted at wordpress.com so I didn’t have #1 as an option. Fortunately, Thomas Frössman has an awesome project called exitwp. The readme is pretty self explanatory so no need for details here.

Storing the Blog

S3 + static blog = win. Thanks to Jerome Bernard for the tip on how to make this jive with Octopress so easily.

Switching Images from wordpress.com to Amazon CloudFront “CDN”

Deciding to take advantage another Amazon service, I decided to move my images to CloudFront.

1
2
3
4
5
6
7
8
9
# get old image locations
grep -h files\.wordpress\.com * | awk -F\( ' { print $2 } ' | sed -e 's/)]//' > /tmp/imgs.txt
# download them
wget -x -i /tmp/imgs.txt
# ship 'em off to S3 so they can sync with CloudFront
mv ihashacks.files.wordpress.com img
s3cmd sync --acl-public --reduced-redundancy img s3://cdn.ihashacks.com/
# update the links
sed -r -e 's/https?:\/\/ihashacks.files.wordpress.com/http:\/\/cdn.ihashacks.com\/img/g' *

Enabling Comments

1
2
cd source/_posts
sed -i 's/layout:\ post/layout:\ post\ncomments:\ true/g' *

Misc Cleanup

1
2
cd source/_posts
sed -i '/^wordpress_id/d' *

Comments