在数据无缝对接且UR不变的情况下WordPress网站转开源yzmcms

[全站通告] 想快速节省您的时间并可接受付费的朋友,可扫右边二维码加博主微信-非诚勿扰!

一个网站的源码用久了可能就不愿意更换,也可能有其他原因就会更换,就比如前几天的dedecms收费,站内还写了关于dedecms转yzmcms

织梦Dedecms站点转开源内容管理系统YzmCMS教程(含插件下载)

当我们的网站原来是用wordpress做的现在想转用yzmcms程序,就需要将模板和数据都转到yzmcms并且保持原来的链接URL不能变,至于模板是比较简单的,浏览器另存为html文件再对照官方标签文档套用即可,这里推荐yzmcms模板标签助手(    YzmCMS内容管理系统模板标签助手    )但是数据库要转移至yzmcms这时该怎么办呢,老梁分享一下wordpress网站数据库无缝转移至yzmcms,话不多说,直接上代码:

/**插入基础表信息**/
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网站的数据库中的以下数据表导出.sql文件,

然后,分别将这些.sql导入至yzmcms程序的数据库中,最后再用上面的代码分别执行一次,这样进入yzmcms程序的后台再看数据就会发现数据已经全部转过来了,最后系统设置里填写好域名,再批量更新URL,至此,wordpress数据就全部成功转移至yzmcms了。

问题未解决?付费解决问题加Q或微信 2589053300 (即Q号又微信号)右上方扫一扫可加博主微信

所写所说,是心之所感,思之所悟,行之所得;文当无敷衍,落笔求简洁。 以所舍,求所获;有所依,方所成!

支付宝赞助
微信赞助

免责声明,若由于商用引起版权纠纷,一切责任均由使用者承担。

您必须遵守我们的协议,如您下载该资源,行为将被视为对《免责声明》全部内容的认可->联系老梁投诉资源
LaoLiang.Net部分资源来自互联网收集,仅供用于学习和交流,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。 敬请谅解! 侵权删帖/违法举报/投稿等事物联系邮箱:service@laoliang.net
意在交流学习,欢迎赞赏评论,如有谬误,请联系指正;转载请注明出处: » 在数据无缝对接且UR不变的情况下WordPress网站转开源yzmcms

发表回复

本站承接,网站推广(SEM,SEO);软件安装与调试;服务器或网络推荐及配置;APP开发与维护;网站开发修改及维护; 各财务软件安装调试及注册服务(金蝶,用友,管家婆,速达,星宇等);同时也有客户管理系统,人力资源,超市POS,医药管理等;

立即查看 了解详情