主题: 已成功导入旧论坛的帖子
Hi, all.
经过一番折腾,已成功将旧论坛的帖子导入到现在的新论坛。在此分享一下转换的 SQL 命令:
/* 导入帖子主题 */
INSERT INTO iredmail_forumzh.topics (forum_id, id, poster, subject, posted, last_post, first_post_id, last_post_id, last_poster) SELECT 3, tid, author, subject, dateline, dateline, pid, pid, author from iredmail_iredbbs.discuz6_posts where and fid=2
/* 导入帖子主题的正文以及回复贴 */
INSERT INTO iredmail_forumzh.posts (topic_id, poster, poster_id, posted,message,poster_ip, id) SELECT tid,author,authorid,dateline,message,useip, pid from iredmail_iredbbs.discuz6_posts where fid=2
这里只是简单的将内容转换过来了,但没有做更精细的处理。例如一个主题总共有多少回复贴,等等。够用就行。