您現在的位置是:首頁 > 建站教程 > yzmcms教程yzmcms教程
wordpress網站轉yzmcms,數據無縫對接
小郭2021-03-22 20:03:01【yzmcms教程】6238人已圍觀
簡介當我們的網站原來是用wordpress做的現在想轉用yzmcms程序,我們就需要將模板和數據都轉到yzmcms并且保持原來的鏈接Url不能變,至于模板是比...
當我們的網站原來是用wordpress做的現在想轉用yzmcms程序,我們就需要將模板和數據都轉到yzmcms并且保持原來的鏈接Url不能變,至于模板是比較簡單的,瀏覽器另存為html文件再對照官方標簽文檔套用即可,這里小郭推薦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了。

- 版權申明:此文如未標注轉載均為本站原創,自由轉載請表明出處《小郭博客》。
- 本文網址:http://www.guestpostingtalk.com/yzmcmstech/460.html
- 上篇文章:YzmCMS用一個模型實現類似字段綁定欄目的功能
- 下篇文章:已經是最后一篇
YzmCMS標簽大全
最新發表
標簽云 更多
-
短視頻(1)
楊倩(1)
提拉米蘇(1)
大家財險機動車輛保險(1)
王一博(1)
肖戰(1)
蘇炳添(1)
劉德華(1)
小鵬汽車(1)
高考(3)
阿里云(1)
HR(1)
鄧倫(1)
李莎(1)
杜淳(2)
PHP教程(7)
陳好(1)
playhouse(1)
fopen(1)
山村瘋狂(1)
第二書包(0)
69樂園(1)
牡丹江民心網(1)
授課到天亮(1)
天天綜合(2)
好人島(1)
符印巨樹(1)
男子漢圖庫(1)
采花小綿羊(1)
渦卷花束(1)
一方嘉通(1)
李心草(2)
半藏森林不帶套(2)
王鎂幼(2)
嫦娥五號(3)
周冬雨(1)
黃曉明(1)
金雞獎獲獎名單(3)
網頁計數器(2)
成都大學(1)
中科創星(1)
馬拉多納(4)
世界互聯網大會(2)
porndao(1)
web前端(6)
網站優化(6)
cookie(2)
session(2)
301重定向(1)
headerlocation(1)
百度站內搜索(1)
愛奇藝(2)
愛奇藝彈幕開關不見了(1)
制作網頁教程(4)
劉詩昆(1)
react(1)
linear-gradient(1)
旅游網站建設方案(1)
我愛自學網(2)
諾貝爾(1)
筆記(1)
居里夫人(1)
郭德綱(1)
楊紫(2)
螞蟻金服上市時間(3)
愛琴海(1)
李連杰(1)
陳佩斯(1)
梁靜茹(2)
個人網站模板(0)
個人網站制作(3)
個人網站(3)
網頁制作(10)
帝國CMS(6)
百度地圖API(2)
偽靜態(2)
jizhicms(6)
1024(3)
去除bom(1)
Git(2)
中國人民志愿軍(2)
麒麟9000(2)
Mate40(2)
新冠病毒(15)
摩天輪(1)
布達佩斯(1)
div居中(2)
新冠疫苗最新消息(12)
新冠疫苗(6)
昆侖飯店(2)
趙麗穎(6)
正面照(2)
石原里美(2)
店員(1)
理發(2)
十幾萬(1)
伊能靜(1)
京東(4)
sublimeText(1)
dreamweaver(1)