Drupal到Wordpress - 迁移评论

时间:2012-08-03 15:02:27

标签: wordpress drupal

我有一个Drupal 6.25数据库,我正在尝试迁移到Wordpress(v3.4.1)。我可以将内容复制到Wordpress中,但是当涉及到评论时,我似乎无法将thread列(在Drupal评论表中)转换为comment_parent(在Wordpress wp_comments中)。

以下是我正在使用的代码(取自tutorial):

INSERT INTO `mywordpress`.wp_comments
(comment_post_ID, comment_date, comment_content, comment_parent, comment_author,
comment_author_email, comment_author_url, comment_approved)
SELECT DISTINCT
    nid, FROM_UNIXTIME(timestamp), comment, thread, name,
    mail, homepage, ((status + 1) % 2)
FROM mydrupal.comments;

上述功能不起作用,因为Wordpress comment_parent是BIGINT类型,而Drupal thread列是VARCHAR,其值为0a.01.03.00/

如何将这些转换为与Wordpress兼容的值?

1 个答案:

答案 0 :(得分:1)

您可以尝试此查询(我已从此tutorial中获取):

UPDATE IGNORE wordpress.wp_term_relationships, wordpress.wp_term_taxonomy
SET wordpress.wp_term_relationships.term_taxonomy_id = wordpress.wp_term_taxonomy.term_taxonomy_id
WHERE wordpress.wp_term_relationships.term_taxonomy_id = wordpress.wp_term_taxonomy.term_id