首页 > 且听风吟 > discuz转换到wordpress
2024
04-28

discuz转换到wordpress

将discuz论坛的帖子转换到wordpress文章。网上找不到任何参考,搜索结果被AI污染,几个靠前的搜索是AI自动生成的,内容完全虚构。只能自己动手了。

转换时间格式

ALTER TABLE bbs_forum_post ADD COLUMN posttime DATETIME;
UPDATE bbs_forum_post
SET posttime = DATE_FORMAT(FROM_UNIXTIME(dateline), '%Y-%m-%d %H:%i:%s');

调整pid和tid

UPDATE bbs_forum_post SET `pid`=`pid` + 12000;
UPDATE bbs_forum_post SET `pid`=`pid` - 10000;

文章转换

insert into `dr_posts`(`ID`,`post_author`,`post_date`,`post_date_gmt`,`post_content`,`post_title`,`post_excerpt`,`post_status`,`comment_status`,`ping_status`,`post_password`,`post_name`,`to_ping`,`pinged`,`post_modified`,`post_modified_gmt`,`post_content_filtered`,`post_parent`,`guid`,`menu_order`,`post_type`,`post_mime_type`,`comment_count`) select `tid`,'1',`posttime`,`posttime`,`message`,`subject`,'','publish','close','close','',`subject`,'','',`posttime`,`posttime`,'',`tid`,'https://www.dungeonraid.com/','1','post','','0' from `bbs_forum_post` WHERE `first`=1

评论转换

insert into `dr_comments`(`comment_ID`,`comment_post_ID`,`comment_author`,`comment_author_email`,`comment_author_url`,`comment_author_IP`,`comment_date`,`comment_date_gmt`,`comment_content`,`comment_karma`,`comment_approved`,`comment_agent`,`comment_type`,`comment_parent`,`user_id`)
select `pid`,`tid`,`author`,'','',`useip`,`posttime`,`posttime`,`message`,'0','1','','comment','0',`authorid` FROM bbs_forum_post WHERE `first`=0
觉得文章有用,微信打赏一元。



discuz转换到wordpress》有 1 条评论

  1. site 说:

    What's up to every body, it's my first go to see of this webpage; this blog includes
    awesome and genuinely excellent data designed for readers.

留下一个回复

你的email不会被公开。