先看看DiscuzX2的文章表,主要涉及到两个:dzz_portal_article_title和dzz_portal_article_content
再看看PHPWind8的表,也是两个:pw_cms_article和pw_cms_articlecontent
其中DiscuzX2的表字段如下:
表dzz_portal_article_title-->
aid | catid | bid | uid | username | title | shorttitle | highlight | author | from | fromurl | url | summary | pic |
---|
表dzz_portal_article_content-->
cid | aid | id | idtype | title | content | pageorder | dateline |
---|
与其对应的表PHPWind8的
pw_cms_article字段:
article_id | subject | descrip | author | username | userid | jumpurl | frominfo | fromurl | column_id | ifcheck | postdate | modifydate | ifattach | sourcetype | sourceid |
---|
pw_cms_articlecontent:
article_id | content | relatearticle |
---|
实现数据转移的代码如下:
insert into `pw_cms_article`(subject,descrip,author,username,userid,jumpurl, frominfo, fromurl,column_id,ifcheck,postdate,modifydate,ifattach,sourcetype,sourceid)
(select title,summary,'','admin',1,'','','',1,'2','1321518259',0,0,0,0 from `discuzz2`.`dzz_portal_article_title`);
insert into `pw_cms_articlecontent`(article_id,content) select * from(
select `wind87`.`pw_cms_article`.`article_id`,`discuzz2`.`dzz_portal_article_content`.`content` from `wind87`.`pw_cms_article` join `discuzz2`.`dzz_portal_article_content`) as xlb;
或
insert into `pw_cms_articlecontent`(article_id,content)
select `wind87`.`pw_cms_article`.`article_id`,`discuzz2`.`dzz_portal_article_content`.`content` from `wind87`.`pw_cms_article`, `discuzz2`.`dzz_portal_article_content`;