将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
- 本文固定链接: https://www.fengshen.cn/2024/04/discuz转换到wordpress/diyofwind/
- 转载请注明: fengshen 发表于 Dream of Wind | 一梦风神
觉得文章有用,微信打赏一元。

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.