Migrating from Nucleus to WordPress

Apparently the consequence for neglecting a blog for too long and failing to diligently update its software is that spammers will hijack it and insert invisible links to male enhancement products. Not that I didn’t realize this before, but…

Anyway, I’ve moved to a different CMS and taken steps to at least harden it against bot attacks (paying particular attention to this security whitepaper from BlogSecurity).  One side-effect of this is that the site has a new (if not original) design. Another is that it’s lost all of its original comments. I’ve saved them so that I can restore them in the future if time permits, but they’re gone for now.

Below the fold: my notes on migrating from Nucleus to WordPress.

First: I found this post on the migration to be really useful.  The technique used consists of simply writing out all the Nucleus posts to an RSS feed, cleaning the feed up a bit, and importing it into WordPress.  It works for me because:

  • My blog posts had very few images in them.
  • I had very few comments on my posts.
  • Only a few of my posts had significant traffic to them.

In short, it was easy because my blog isn’t terribly popular, and because it was a lot more annoying to include media in Nucleus posts than it is in WordPress.

To clean up the RSS feed using regular expressions, Jess uses something called TopStyle Pro, which costs about $80 (though it looks like there’s a free trial on the website).  I decided it would be easier to just use vim, which has the advantages (to me) of being both free (like speech and like beer) and already installed on my machine.

While there are a number of good tutorials on using VIM and Regex, I figure it might help someone if I share the commands I used to clean up the RSS feed…

These eliminate this: <![CDATA[ ... ]]>

:%s/]]>//g
:%s<!\[CDATA\[//g
 
This eliminates this: <link> … </link>
 
:%s/<link>.*<\/link>//g
 
This eliminates this: <comments> … </comments>
 
:%s/<comments>.*<\/comments>//g
 
This replaces <b> with <strong>
 
:%s/<b>/<strong>/g
 
This replaces </b> with </strong>
 
:%s/<\/b>/<\/strong>/g
 
I had an issue with line breaks in links in my Nucleus skin, forcing me to use non-breaking spaces.  Thus:

:%s/&nsbp;/ /g

Also, of course, quit and save:

:x

Or quit and discard changes:

:q!

If you’ve run across this and found it helpful, leave me a note.

One Response to “Migrating from Nucleus to WordPress”

  1. A Note on Humility | The Reconstruction Says:

    [...] mentioned before, I recently performed some major maintenance on the site.  In the process, I found myself reading through a lot of my old posts.  I found some [...]

Economics, Energy, and the Environment.