Hello world again

I may be getting interested in writing stuff again with more depth and detail, appropriate (even if small) audience, and with clearer ownership than social networks provide. Twitter is cool as a sort of RSS aggregator; Facebook has become intrusive, annoying and just generally inadequate for anything but on-the-fly photo and YouTube sharing; and Google+ has flatlined. In preparation for more writing, I have added a WordPress blog to my site, because my old blog system was fun to write but boring to maintain and extend.

I imported all the old content, converted the markup with a php script (destroying a bunch of stuff along the way) and deleted most of the old spam comments I could find (over 700).

Lots of settings, style and layout still to do, but it’s a start. Update your RSS if you are a subscriber!

5 thoughts on “Hello world again

  1. Bring main posts from my old blog tables. In my old blog, posts and comments were stored in the same table, with a post being “main” if TopicID is zero, otherwise it is a comment and TopicID is the ID of the post being commented on. I imported the old posts starting with an ID of 1000 just to make them easy to find.

    INSERT INTO wp_XXX_posts (ID, post_content, post_title, post_name, post_date, post_excerpt, to_ping, pinged, post_content_filtered)
    SELECT (ID+1000) as kk, NewsText, NewsSubject, NewsName, NewsDate, "", "", "", NewsText FROM YYY_Posts WHERE TopicID=0;

    Bring the comments:

    INSERT INTO wp_XXX_comments (comment_ID, comment_post_ID, comment_content, comment_author, comment_date)
    SELECT ID, (TopicID+1000) as kk, NewsText, NewsName, NewsDate FROM YYY_Posts WHERE TopicID<>0;

    Update the number of comments for each post. After cleaning up spam using SQL queries directly, I had to redo this.

    UPDATE wp_XXX_posts SET comment_count=(SELECT COUNT(*) FROM wp_XXX_comments WHERE comment_post_ID=ID);

    Some of that may be unnecessary but it was my first try and it seemed to work, so who am I to complain. ๐Ÿ™‚

  2. So proud of you. Linux, MySQL, WordPress (beware there are exploits to it every now and then).

    You’ve finally grown up!

  3. A lot of the dates for old comments look broken in the RSS. ๐Ÿ™ Need to solve that before Mr. Lopez hurts me. ๐Ÿ™‚

    Edit: sorted, the post_date_gmt field was defaulting to ‘0000-00-00 00:00:00’

Comments are closed.