今天麥子遇到一個(gè)問(wèn)題,有個(gè)朋友原來(lái)網(wǎng)站的程序是ZBLOG,由于他的網(wǎng)站數(shù)據(jù)不多就沒(méi)有采用遷移轉(zhuǎn)換程序的方法。如果我們需要遷移轉(zhuǎn)換程序可以參考 「一篇文章記錄ZBlog PHP站點(diǎn)數(shù)據(jù)轉(zhuǎn)換WordPress遷移過(guò)程實(shí)戰(zhàn)」,他就幾篇文章就直接手動(dòng)復(fù)制到新的WP站點(diǎn)中。
不過(guò)基于SEO的考慮和URL一致性,我建議他還是將ID進(jìn)行修改到和原來(lái)網(wǎng)站URL一致的ID,這里我們用什么辦法呢?
update wp_posts set id = 111 where id = 222; update wp_posts set post_parent = 111 where post_parent = 222; update wp_term_relationships set object_id = 111 where object_id = 222; update wp_postmeta set post_id = 111 where post_id = 222; update wp_comments set comment_post_ID = 111 where comment_post_ID = 222;
這里我們可以先進(jìn)行備份數(shù)據(jù),然后用這個(gè)辦法在SQL中替換,注意111為修改后的ID,222為修改前的ID。
評(píng)論