2012-08-03 156 views
0

我有一個Drupal 6.25數據庫,我試圖遷移到Wordpress(v3.4.1)。我可以將內容複製到Wordpress中,但是對於評論,我似乎在將thread列(在Drupal評論表中)轉換爲comment_parent(在Wordpress wp_comments中)時遇到了問題。Drupal to Wordpress - 遷移評論

下面是我使用的代碼(從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

你可以試試這個查詢(我已經從這個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