Migrating from Blogger to Ghost

I just moved my blog from Google's Blogger platform onto a self hosted Ghost platform.

Why?

  1. Markdown - Rather than using the WYSIWYG editor of blogspot, I am now using Markdown. I spend less time fiddling with content structure and more time writing. It's also really good with code.

  2. Code - Previously I've been mixing <pre> blocks with gists and found them all to be a bit underwhelming. Markdown supports code blocks much better than anything else.

  3. Docker - I wanted to brush up on my DevOps skills and run the site on top of Docker and Digital Ocean.

Where?

I'm hosting this blog on Digital Ocean. I'm running a number of sites here on top of Docker. It was actually a breeze to set up.

What?

Content started to die out. I've had a handful of posts in the last few months and I wanted to get back into the habit of posting. Hosting this blog will be a subject of future posts (as I set up monitoring and other things). The blog will continue to be tech oriented.

When?

As soon as I finish this post.

Who?

Me still.

How?

This section is really the reason for the post. I want to detail the approach I took to move from blogger to ghost on Digital Ocean.

Digital Ocean

First I launched a 512MB instance on Digital Ocean. I used the Docker Ubuntu 14.04 image. That was pretty much it. As always, Digital Ocean has been super simple and great bang for your buck.

Ghost

Setting up ghost was pretty simple. One liner from dockerfile/ghost:

docker run -d -p 8080:2368 -v undiscoveredfeatures-ghost:/ghost-override dockerfile/ghost  

I then installed nginx and configured it for vhost proxy_pass. The allowed me to set up a few other sites on the same box.

I then followed the ghost instructions (all via the browser) to finish setting up the blog.

Performance

Using wrk I was able to load test the box. It topped out around 60 requests/second with 100% CPU utilization. I don't get much load, but occasionally I get on hacker news and have to deal with a significant spike. I configured nginx to cache each page for 10 seconds and I was able to easily hit 450 requests/second wiht 20% CPU utilization. That should be plenty. 10 seconds is a perfectly acceptable in my opinion.

Old Posts

First off, I decided to ignore comments from my old blog. I'm using Disqus for comments now and trying to move the comments over was either impossible or not worth the effort.

I used this tool to export my blogger posts. After I imported I found that it didn't do the greatest job. I had to go through each post and clean them up. Some of them had all sorts of garbage formatting and extra tags from Blogger. Most of my work was simplifying the formatting and using Markdown instead of my previous approaches.

One problem I found was that the urls didn't match. I didn't want to lose my SEO related rankings and links so I put a lot of effort into making them match perfectly. Nginx was helpful:

rewrite "^/[0-9]{4}/[0-9]{2}/(.+)\.html$" /$1 permanent;

That rewrote urls from /2014/08/some-title to /some-title. I then went though all the urls (via Ghost's admin panel) and updated them to make them match. There were a bunch of little quirks with symbols where blogger ignored them but ghost was trying to use _ instead.

The Switch

Once I had everything moved over, I switched my DNS over to the new server and everything was good to go.

Conclusion

Overall I have enjoyed Ghost. I think Markdown is simple to use and learn (I'm even trying to get my wife to learn it for her blog). I'd recommend making the switch. If you aren't inclined to host your own blog, Ghost has a hosting service as well. Play around with it and let me know what you think.

comments powered by Disqus