新系统测试

是的,还是决定从drupal迁移到wordpress上。

因为数据库服务器挂了,数据修复后,drupal竟然不认修复的数据,那么咱们也只好死马当活马医,看起来wordpress的数据结构较为简单,直接把所有内容都迁移到wordpress上吧。

以下是迁移用的脚本。

insert into wp.wp_posts 
(post_author,post_date,post_date_gmt,post_title,post_content,post_excerpt,post_status,comment_status,ping_status,post_name,post_modified,post_modified_gmt,post_type)
SELECT 
1 as post_author,
FROM_UNIXTIME(n.created) post_date,
FROM_UNIXTIME(n.created) post_date_gmt,
n.title post_title,
b.body_value post_content,
''  as post_excerpt,
'publish' as post_status,
'open' as comment_status,
'open' as ping_status,
n.title post_name,
FROM_UNIXTIME(n.changed) post_modified,
FROM_UNIXTIME(n.changed) post_modified_gmt,
'post' post_type
 FROM maker.`node` as n
left join maker.field_data_body as b
on n.vid = b.revision_id

希望你永远用不上上面的脚本,实际上迁移以后还是有点问题,比如可能点开提示404,但是至少数据过来了,在后台可以很轻易的进行修复。

参考:http://blondish.net/how-to-convert-drupal-to-wordpress/

Leave a Reply

Your email address will not be published. Required fields are marked *