WordPress blog migration notes

Yesterday I flipped the switch and moved this site to a new domain. If you’ve been considering something like this, it is a very straightforward process. Here are a few details I picked up along the way that I want to point out. There are some tools that will automate the migration for you, but I wanted more control and also wanted to make sure I got a few things exactly right.

Platform

This is all geared toward WordPress users. I considered a move away from WordPress to Octopress or Jekyll. These are awesome tools, but at the end of the day I don’t think they’re right for me right now. I like my theme. I want to primarily write this blog from my iPad and keep the setup as simple as possible. And—knock on wood—I have never had performance issues with WordPress (w/ caching). I had a post hit the front page of Hacker News a few months ago and it performed fine on shared hosting.

There are a couple of ways to preserve in-bound links pointed at your old domain, but the easiest way is the .htaccess file. This took me longer to figure out than it should have, but this tip from Stephen Hackett pointed me in the right direction. You need to place (or modify) a file called .htaccess in the root directory of the old domain. Edit this file to add the following line at the start:

RedirectMatch permanent (.*) http://onlyamodel.com$1

Make sure you permalink structure on the new blog matches the old one. That’s it; your old permalinks now forward to the new ones.

Cleaning up data

There were several housecleaning items I wanted to clean up in the XML Export from the old blog before importing to the new. I did all of this with several dozen find-and-replace moves in Sublime Text. Obviously I replaced all instances of the old domain with the new. I switched to Disqus once and then back again, so there were some inconsistencies in comment data. I cleaned up all the past versions of my name/email so all of my comments would get mapped to my account in the new install. Anything else you want to scrub site-wide, this is the time.

One side note: If your WordPress XML file is bigger than 2mb, the importer will recommend you split it up. Depending on your server configuration, you may can upload a gzipped version. It worked perfectly for me.

Before you upload your media archive to the new site, it’s also a good time to run your blog’s image archive through a tool like ImageOptim to reduce your blog’s footprint a bit. I try to compress images before uploading, but oftentimes forget.

Updating relevant services

Google Webmaster Tools has a nice utility where you can tell Google that your site has migrated to a new domain. This helps Google index your content the right way and regain some search engine cred.

Feedburner RSS links don’t have to change; just change the source rss feed and all your subscribers will get content from the new domain. The only pain point here is knowing you’re going to spam your subscribers with the most recent ten posts again.

Google Analytics is simple as well. Use your same ID and you won’t lose any stats.

A few design comments

I’ve said this many times, but I really like the Standard Theme and the folks behind it. If you are thinking about redesigning your site, I highly recommend it as a starting point. There are very active communities for theme support as well as child theme development on Github. The new design was loosely inspired by Edward Tufte’s website, and Standard made this relatively simple to build out. I also wanted the site to have a slightly warmer feel, hence the shift to a brown/red palette instead of grey/blue.

I decided to keep comments for now because most comments I get are really helpful. However, I really dislike the idea of comment counts as social proof. On a lot of sites I really like, the best material gets few comments. So, I nuked all instances I could find where comment counts are displayed. I turned this off using CSS display:none’s in the child theme instead of modifying PHP files. In a well-written theme, you can get an awful lot done with nothing but CSS tweaks.

I have also thought a lot about starting a linked-list aspect on this site. I have implemented this functionality as of now, but I’m not sure yet whether I will do this or not. John Gruber I am not, but perhaps there is another version of me that would like to read all the miscellany I find. But I wanted to have the option to play with it in the future, so we’ll just have to see on that one.