首先把zblog数据库中的zbp_post表中的一些字段如log_Id,log_Title,log_Content,log_PostTime中导出来,注意编码一致
把数据库文件导入到DISCUZ论坛中的 pre_forum_post表中的对应的字段pid ,fid,tid,subject,dateline,message以及pre_forum_thread表中的tid,fid,subject中,注意第2步的一些字段是关联的。
数据导入完毕后需要替换数据库中一些网址
UPDATE zbp_post SET log_Content=REPLACE(log_Content,\'http://www.aiyiliu.com/\',\'http://www.aiyiliu.com/\');
以及信息 批量替换论坛贴子标题:
UPDATE pre_forum_thread SET subject=REPLACE(subject,\'替换前\',\'替换后\');
批量替换论坛贴子内容:
UPDATE pre_forum_post SET message=REPLACE(message,\'替换前\',\'替换后\');
UPDATE pre_forum_post SET message=REPLACE(message,\'CommShow\',\'hide\');
帖子里面都是HTML代码,需要把你要导入的帖子栏目中开启html代码功能,后台论坛》版块》帖子选项》允许使用 HTML 代码选择是
最后一步发布帖子的时候会提示Discuz! Database Error(1062) Duplicate entry \'369\' for key 2 INSERT报错,解决方法:
步骤:首先找到pre_forum_post获取最新帖子的pid即最大值,然后打开pre_forum_post_tableid表,添加最大值的pid即可!