I finally got sick of the blog spam under my very hacked up version of Nucleus, so I’ve shifted myself to using WordPress. Apologies if the RSS feed has just given you the past 10 articles as being ‘new’, or whatever.
Anyway, in porting all the data from Nucleus I happened upon nucleus2wordpress.pl which purported to be a hack to shift all the posts from old versions of Nucleus into, er, WordPress. It didn’t work first time since the categories system within WordPress has changed so I’ve frigged it to work with the new WordPress taxonomy system.
You can download my updated version (which works with WordPress 3.3) here – no guarantees implied etc. and it depends on your Nucleus database being the same as your WordPress database (I just copied the tables over and then removed the Nucleus ones when I was happy). Enjoy!
I’ll be back blogging soon. ‘Interesting times’ over the past six months have taken priority…
Addendum: After running this script and becoming more familiar with the concepts involved in the WordPress database, I discovered the comment counts were incorrect (even though the imported comments themselves appeared within the posts). To correct this, run the following on your WordPress database (remembering to back it up first!):
UPDATE wp_posts wpp LEFT JOIN (SELECT comment_post_id AS c_post_id, count(*) AS cnt FROM wp_comments WHERE comment_approved = 1 GROUP BY comment_post_id) wpc ON wpp.id=wpc.c_post_id SET wpp.comment_count=wpc.cnt WHERE wpp.post_type IN ('post', 'page') AND (wpp.comment_count!=wpc.cnt OR (wpp.comment_count != 0 AND wpc.cnt IS NULL));
This worked fine on WordPress 3.3 and corrected the comment counters on the front page and search results.
Leave a Reply