Hello folks!
Lately, I haven’t updated the site frequently, mainly because I am very busy these days, and managing my site just keeps falling on the back burner. Lots of things have happened with me over the last year and a half, from relocating to Seattle, starting a new job, buying a car, buying a condo, to going out, having a good time with friends, trying to meed decent girls.
I wish I’d updated my blog, there’s so much to say, so little time to express it. To make matters worse, my Drupal installation seems to have gone south since Site5, my web host, migrated the site to another server and performed some updates with PHP, MySQL. So, I now paid the price for being lazy updating my blog software.
So, I am now ditching Drupal and switching back again to WordPress. I was able to migrate my old posts by hacking into the DB, but not the rest because it is a lot of work, and I don’t really care about it. So, if there’s something in particular you’re looking for just ask, I probably have it backed up somewhere, and hopefully I will be able to write more here.
For those who are interested, here are the queries for migrating drupal “stories” into drupal “posts”:
INSERT INTO wordpress.wp_posts
(ID,
post_author,
post_date,
post_date_gmt,
post_content,
post_title,
post_excerpt,
post_status,
comment_status,
ping_status,
post_name,
post_modified,
post_modified_gmt)
SELECT
@rownum:=@rownum+1,
1,
FROM_UNIXTIME(node.created),
FROM_UNIXTIME(node.created+14400),
node_revisions.body,
node.title,
node_revisions.teaser,
'publish',
'open',
'open',
concat('archive-post-',node.nid),
FROM_UNIXTIME(node.changed),
FROM_UNIXTIME(node.changed+14400)
FROM node, node_revisions, (SELECT @rownum:=3) r
WHERE type = 'story' and node.nid = node_revisions.nid
Then, for some reason, some posts were from 1969
. I looked in the DB and found there’s a post date and a modified date. The modified date was correct, so I assume at some point drupal or maybe even my old wordpress installation only kept a last modified date. Drupal keeps dates in unix time (number of seconds since Midnight, January 1, 1970) That explains it, the modified GMT date is 0 (bogus) and the last modified local date (GMT-4 for Montreal) is in 1969! So, for these posts copying the modified date into the post date did the trick:
update wp_posts
set post_date = post_modified, post_date_gmt = post_modified_gmt
where
YEAR(post_date_gmt) = 1970