Nelz's Blog

Mah blogginess

The New Nelz.net

Welcome to the new and improved Nelz.net!

Background

I started this blog way back in the beginning of 2007. At the time, I wanted more than just a blog host, I wanted a host where I could deploy other Java webapps if I felt the need. (For other side projects, y’know.) Following the lead of Matt Raible, I chose KGBInternet to host a Roller (which wasn’t then, but is now an Apache project) blog instance. Keith, the proprietor of KGBInternet, is incredibly responsive and I’d have to say that his service was a great $20/month host where you get full command-line access and control over your JVM/Tomcat instances.

A couple of months ago, I decided to critically look how I use my different online providers.

I had been maintaining a cheap, $5/month GeekISP account for personal data SVN hosting/backup. Since most of my projects are Open Source (and usually hosted on Google Code), I realized I wasn’t really using my account, so I dropped it.

And when I critically looked at my usage of KGBInternet, I realized that I was only using it for maintaining my blog. That’s $240 (Candian) bucks per year for blog hosting, which could be done for much less by another provider. So, I decided to drop that account.

Getting Data Out Of Roller

The biggest problem I had was trying to get my blog content out of Roller. There is no “Export” functionality, which frustrated me to no end. I found a posts with a tutorial on how to export directly from the database, but that wouldn’t work from me because 1) I didn’t want to go through a PHP export process, and 2) my db entries are all in JSPWiki markup (via the Roller JSPWiki plugin). I found another post showing how to get my data out using Roller templates, but that wasn’t going to specifically work for me, since I wasn’t going to be hosting my own Wordpress install. However, the concept of using the built-in Roller template capabilities had a bunch of potential.

At this point, I wasn’t yet sure if I was going to end up using Wordpress.com or Blogger. My investigations proved that Blogger only likes to import/export in their own format, for which I could find no documentation. Wordpress however has several import capabilities, so I figured I’d target Wordpress, and maybe use some of the community Wordpress –> Blogger converters if I needed to move my stuff over to there.

Wordpress has its own WordPress eXtended RSS (WXR) syntax, but it’s not easy to get a definitive format information. Wordpress will import from a MoveableType export file, which is actually very well-documented. This is what basically decided me on moving to Wordpress, at least for the time being…

By referring to both the MoveableType documentation and the Roller templating guide, I was able to create the following template:

 1  #set($pager = $model.getWeblogEntriesPager())
 2  #set($map = $pager.getEntries())
 3  #foreach( $day in $map.keySet())
 4  #set($entries = $map.get($day))
 5  #foreach( $entry in $entries )
 6  TITLE: $entry.title
 7  AUTHOR: nelz9999
 8  DATE: $utils.formatDate($entry.pubTime, "MM/dd/yyyy HH:mm:ss")
 9  CATEGORY: $entry.category.name
 10  -----
 11  BODY:
 12  $entry.transformedText
 13  #foreach( $comment in $entry.comments )
 14  -----
 15  COMMENT:
 16  #if ("$comment.name" != "")
 17  AUTHOR: $comment.name
 18  #end
 19  DATE: $utils.formatDate($comment.postTime, "MM/dd/yyyy HH:mm:ss")
 20  #if ("$comment.email" != "")
 21  EMAIL: $comment.email
 22  #end
 23  #if ("$comment.url" != "")
 24  URL: $comment.url
 25  #end
 26  $comment.content
 27  -----
 28  #end        
 29  --------
 30  #end
 31  #end

One of the keys in the above template is Line #12. Instead of using “$entry.text”, I use “$entry.transformedText”, which applies all the JSPWiki formatting. (And, if you’re copy/pasting this template, be sure to update the “AUTHOR:” tag on Line #7 to something appropriate for you…) Keep in mind that this gets you one page of (published, not draft) content at a time, as defined by the “Number of entries to display on weblog” parameter in the Preferences –> Settings tab. You get to later pages of data by appending “?page=X” (0 being the default) to the URL: “http://nelz.net/roller/nelz/page/moveabletype.tmpl?page=1”.

It is then a simple matter of doing a “wget” for each page: “wget http://nelz.net/roller/nelz/page/moveabletype.tmpl?page=1 -O page1.txt”. If you have lots of posts, I’d recommend upping your entries/page setting, so you have less individual files to manage, but also beware of your file sizes getting too big… I left my entries/page setting at 10, and I ended up managing 14 files. Had I set it to 50 entries/page, it would have been only 3 files.

But, now you’ve got most of your content (not images and stuff tho) in a portable format!

Getting Data Into Wordpress

After creating my Wordpress.com account, it was pretty simple to get the data in, via the Tools –> Import menu. Now, I had 138 posts in Draft status. I tried using the bulk edit –> publish tool, but for some reason that wasn’t working for me. I published a couple by hand, but then I remembered back to something Neil Ford said at a conference I attended: “our computers get together and laugh at us at night because we keep doing their (repetitive task) jobs for them…” Well, I’ll be damned if I let my computer laugh at me!!

So, I popped open SeleniumIDE, and created a quick little automation to approve all the drafts in my queue, a single iteration of which looks like this:

<tr>
 <td>open</td>
 <td>/wp-admin/edit.php?post_status=draft</td>
 <td></td>
</tr>
<tr>
 <td>click</td>
 <td>link=Quick Edit</td>
 <td></td>
</tr>
<tr>
 <td>select</td>
 <td>_status</td>
 <td>label=Published</td>
</tr>
<tr>
 <td>click</td>
 <td>link=Update Post</td>
 <td></td>
</tr>
<tr>
 <td>waitForText</td>
 <td>//img[@alt='More stats']</td>
 <td></td>
</tr>

This worked swimmingly, and in 30 minutes or so, I published nearly 140 posts “by hand”. :-D

Getting to know Wordrpress

Things that I like about Wordpress:

  • It is a much better interface than Roller
  • “Pages”. I also use my blog as a place to keep an online version of my resume, and Pages allow me to exactly do that without having to use a ‘regular’ blog post that I update over time.
  • Wordpress automagically figures out how to map the old Roller URLs to the new ones. I was getting quite a few links to some of my recent posts, and I really happy that the links floating around the web-o-sphere will still work. (E.g. ”http://nelz.net/roller/nelz/entry/velocity_conference_recap” ends up on the page ”http://nelz.net/2009/06/25/velocity-conference-recap/”.)
  • Setting up my own domain was absolutely painless.

Things that I haven’t yet decided on:

  • You can’t use Google Analytics on a Wordpress.com blog, but they do provide some of their own stats (and there are several other options as well). I haven’t yet decided if it’s better to have the stats easily available in my blog admin, or if I’d have preferred to keep all my analytics stuff together in Google.
  • I haven’t yet purchase the $30/yr no ads upgrade. I haven’t seen any ads on my site as it is, so I’m not sure if I will actually need it?
  • No specific control over robots.txt. Whereas I want 99% of my blog public, I want to prohibit Google from picking up my resume, ‘cuz I kinda hate cold-calls from recruiters (but maybe I’m just being silly).

To Do

  • Some of the formatting (especially on the preformatted code sections) got lost in the migration… I’ll try to go back to the most used ones to reformat.
  • I gotta update that resume of mine.
  • Once I’ve been up on Wordpress for a week or two, I’ll actually cancel my account with KGBInternet.