您的位置:首页 > wordpress

wordpress网站转yzmcms,数据无缝对接
wordpress 2024-9-22编辑:深圳网站建设阅读( WordPress 对接 无缝

当我们的网站原来是用wordpress做的现在【zài】想转用yzmcms程【chéng】序,我【wǒ】们就需要将模板和数据【jù】都转到yzmcms并且【qiě】保【bǎo】持原【yuán】来的链接Url不能变【biàn】,至【zhì】于【yú】模板是比较简单的,浏览器另存【cún】为html文件再对照官方标【biāo】签文档套用即可,这里小【xiǎo】郭推荐yzmcms模板标签助【zhù】手但是数据库要转【zhuǎn】移至yzmcms这时该怎么办呢,本【běn】文【wén】小郭就来【lái】分享一【yī】下wordpress网站数据【jù】库无缝转移至yzmcms,话不多【duō】说,直【zhí】接上代码【mǎ】:

  • /**插入基础表信息**/
  • insert into yzm_article (id,catid,userid,username,nickname,title,seo_title,inputtime,updatetime,keywords,description,click,content,copyfrom,thumb,articledir,url,flag,status,system
  • ,listorder,groupids_view,readpoint
  • ) select ID,0,post_author,'','',post_title,post_title,unix_timestamp(post_date),unix_timestamp(post_modified),'','',0,post_content,'','','',guid,'',1,1,10,0,0
  • from wp_posts where post_parent=0 and post_type='post' and (post_status='publish' or post_status='draft' or post_status='auto-draft')
  •  /**将文章的缩略图信息进行修改**/
  •  update yzm_article y inner join (select s.guid,s.post_parent,a.post_id,a.meta_value  from wp_posts s,wp_postmeta a where meta_key='_thumbnail_id' and a.meta_value=s.ID
  • ) c on y.id =c.post_id set y.thumb = c.guid
  •  /**将文章的摘要信息进行修改**/
  •  update yzm_article y inner join (select s.guid,s.post_parent,a.post_id,a.meta_value  from wp_posts s,wp_postmeta a where meta_key='zhaiyao_value' and a.post_id=s.ID
  • ) c on y.id =c.post_id set y.description = c.meta_value
  •  /**将文章的阅读数进行修改**/
  •  update yzm_article y inner join (select s.guid,s.post_parent,a.post_id,a.meta_value  from wp_posts s,wp_postmeta a where meta_key='views' and a.post_id=s.ID
  • ) c on y.id =c.post_id set y.click = c.meta_value
  •  /**将文章的来源信息进行修改**/
  •  update yzm_article y inner join (select s.guid,s.post_parent,a.post_id,a.meta_value  from wp_posts s,wp_postmeta a where meta_key='laiyuan_value' and a.post_id=s.ID
  • ) c on y.id =c.post_id set y.copyfrom = c.meta_value
  • /**添加分类**/
  • insert yzm_category(catid,catname,catdir,mobname,category_template
  • ,list_template
  • ,show_template,
  • arrchildid,
  • modelid
  • )
  • select s.term_id,s.name,s.slug,s.name,'category_page','list_article','show_article',s.term_id,1 from wp_terms s,wp_term_taxonomy y where y.taxonomy='category' and y.term_id = s.term_id
  • /**操作分类和文章的关系**/
  • update yzm_article y inner join (
  • select object_id,a.term_taxonomy_id,b.taxonomy from wp_term_relationships a,wp_term_taxonomy b where a.term_taxonomy_id=b.term_id and taxonomy='category')
  • c on y.id =c.object_id set y.catid = c.term_taxonomy_id
  • /**操作标签**/
  • insert yzm_tag  (id,tag,total,inputtime)
  • select a.term_id,b.`name`,a.count,1551964444 from wp_term_taxonomy a,wp_terms b WHERE a.term_id=b.term_id and a.taxonomy='post_tag';
  • /**操作标签和文章的关系**/
  • insert yzm_tag_content  (modelid,aid,tagid,catid)
  • select 1,object_id,term_taxonomy_id,b.catid from wp_term_relationships a,yzm_article b where a.object_id=b.id

以上是文章、分类、标签tag、缩略图等包含网站大部分数据了。

先将wordress网站的数【shù】据【jù】库中的以下数【shù】据【jù】表导出.sql文件,

然后【hòu】,分别将这些.sql导入至yzmcms程序的数据库中,最后再用上面的代码分别执行【háng】一次,这样【yàng】进入【rù】yzmcms程序的后台再【zài】看数据【jù】就会发现数据已经全【quán】部【bù】转过来了,最后系统设【shè】置里【lǐ】填写好域名【míng】,再批量更新URL,至此,wordpress数【shù】据就【jiù】全部成功转移至【zhì】yzmcms了。

服务范围:WordPress搭建、WordPress主题开发、WordPress二次开发、WordPress插件【jiàn】开发
其【qí】它服务:网站建【jiàn】设【shè】、企业邮箱、数字证书ssl、400电【diàn】话、
技术标签:企业网站、外贸网站、外贸商城、其它问题
联系方式:电话:13714666846 微信同号

企业网站定制

企业网站定制 根据企业需求,量身定制设计

企业网站定制:2800元起
添加微信 请说明来意
联系我们
站内搜索 MORE+

24小时服务热线 0755-29765948
  • 地址:深圳市罗湖区人民北路2033号206
  • 电【diàn】话【huà】:0755-29765948 传真:82256610
  • 手机:13714666846 18948334877
  • 邮箱:gong@city96.com 164761418@qq.com
  • 粤ICP备14049207号
创意化数字品牌整合网络营销
营销网站让你坐等商机坐佣客户,Rss

版权所有:深圳市网商在线科技有限公司

版权所有:深圳市网商在线科技有限公司
友情连接link: