在數(shù)據(jù)無縫對接且UR不變的情況下WordPress網(wǎng)站轉(zhuǎn)開源yzmcms

[重要通告]如您遇疑難雜癥,本站支持知識付費業(yè)務(wù),掃右邊二維碼加博主微信,可節(jié)省您寶貴時間哦!

一個網(wǎng)站的源碼用久了可能就不愿意更換,也可能有其他原因就會更換,就比如前幾天的dedecms收費,站內(nèi)還寫了關(guān)于dedecms轉(zhuǎn)yzmcms

織夢Dedecms站點轉(zhuǎn)開源內(nèi)容管理系統(tǒng)YzmCMS教程(含插件下載)

當(dāng)我們的網(wǎng)站原來是用wordpress做的現(xiàn)在想轉(zhuǎn)用yzmcms程序,就需要將模板和數(shù)據(jù)都轉(zhuǎn)到y(tǒng)zmcms并且保持原來的鏈接URL不能變,至于模板是比較簡單的,瀏覽器另存為html文件再對照官方標(biāo)簽文檔套用即可,這里推薦yzmcms模板標(biāo)簽助手(? ? YzmCMS內(nèi)容管理系統(tǒng)模板標(biāo)簽助手? ? )但是數(shù)據(jù)庫要轉(zhuǎn)移至yzmcms這時該怎么辦呢,老梁分享一下wordpress網(wǎng)站數(shù)據(jù)庫無縫轉(zhuǎn)移至yzmcms,話不多說,直接上代碼:

/**插入基礎(chǔ)表信息**/
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=‘a(chǎn)uto-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
/**將文章的閱讀數(shù)進行修改**/
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
/**操作分類和文章的關(guān)系**/
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
/**操作標(biāo)簽**/
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’;
/**操作標(biāo)簽和文章的關(guān)系**/
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

以上是文章、分類、標(biāo)簽tag、縮略圖等包含網(wǎng)站大部分數(shù)據(jù)了。

先將wordress網(wǎng)站的數(shù)據(jù)庫中的以下數(shù)據(jù)表導(dǎo)出.sql文件,

然后,分別將這些.sql導(dǎo)入至yzmcms程序的數(shù)據(jù)庫中,最后再用上面的代碼分別執(zhí)行一次,這樣進入yzmcms程序的后臺再看數(shù)據(jù)就會發(fā)現(xiàn)數(shù)據(jù)已經(jīng)全部轉(zhuǎn)過來了,最后系統(tǒng)設(shè)置里填寫好域名,再批量更新URL,至此,wordpress數(shù)據(jù)就全部成功轉(zhuǎn)移至yzmcms了。

問題未解決?付費解決問題加Q或微信 2589053300 (即Q號又微信號)右上方掃一掃可加博主微信

所寫所說,是心之所感,思之所悟,行之所得;文當(dāng)無敷衍,落筆求簡潔。 以所舍,求所獲;有所依,方所成!

支付寶贊助
微信贊助

免責(zé)聲明,若由于商用引起版權(quán)糾紛,一切責(zé)任均由使用者承擔(dān)。

您必須遵守我們的協(xié)議,如您下載該資源,行為將被視為對《免責(zé)聲明》全部內(nèi)容的認可->聯(lián)系老梁投訴資源
LaoLiang.Net部分資源來自互聯(lián)網(wǎng)收集,僅供用于學(xué)習(xí)和交流,請勿用于商業(yè)用途。如有侵權(quán)、不妥之處,請聯(lián)系站長并出示版權(quán)證明以便刪除。 敬請諒解! 侵權(quán)刪帖/違法舉報/投稿等事物聯(lián)系郵箱:service@laoliang.net
意在交流學(xué)習(xí),歡迎贊賞評論,如有謬誤,請聯(lián)系指正;轉(zhuǎn)載請注明出處: » 在數(shù)據(jù)無縫對接且UR不變的情況下WordPress網(wǎng)站轉(zhuǎn)開源yzmcms

發(fā)表回復(fù)

本站承接,網(wǎng)站推廣(SEM,SEO);軟件安裝與調(diào)試;服務(wù)器或網(wǎng)絡(luò)推薦及配置;APP開發(fā)與維護;網(wǎng)站開發(fā)修改及維護; 各財務(wù)軟件安裝調(diào)試及注冊服務(wù)(金蝶,用友,管家婆,速達,星宇等);同時也有客戶管理系統(tǒng),人力資源,超市POS,醫(yī)藥管理等;

立即查看 了解詳情