Go to content Go to navigation

Restoring the old archives of this blog

I've made a copy of the contents of my old blog to this new one. Unfortunately, the old and lovely AsturLinux blog has some problems due to a strange MySQL error that we don't know how to fix. Many of my old posts were no longer available on the web. I don't think they are extremely interesting, but I was a bit sad of losing them.

It wasn't easy to migrate the data from Drupal to Textpattern. The only helpful resource I found was a sample SQL query. Inspired by that query, I wrote another one that I reproduce at the end of this post in the hope that other people may find it useful. Note, however, that you cannot use it as-is, and it will require customization for your purposes. Moreover, after this query, I had to execute some other queries to fix some minor issues.

So now the archive contains more than 300 old posts, most of them in Spanish, from 2004 to 2007. In other words, a little bit more of noise in the web :-)

INSERT INTO textpattern (Posted, AuthorID, LastMod, Title,
Annotate, status , textile_body, textile_excerpt, Section,
url_title, body_html, uid, feed_time )
SELECT FROM_UNIXTIME( node.created ) AS 'Posted',
'berrueta' AS 'AuthorID',
FROM_UNIXTIME( node.changed ) AS 'LastMod',
node.title AS 'Title',
'0' AS Annotate,
'4' AS status,
'0' AS textile_body,
'0' AS textile_excerpt,
'blog' AS Section,
DATE_FORMAT( FROM_UNIXTIME( node.created ), '%Y%m%d-%H%i' ) AS url_title,
node.body AS Body_html,
node.created AS uid,
DATE( FROM_UNIXTIME( node.created ) ) AS feed_time
FROM node
WHERE node.uid =14