2007年6月2日 星期六

itoc-MapleBBS convert to WordPress 2.2

本文將介紹如何將 itoc-MapleBBS 文章轉換至 WordPress 2.2 (WP)

將使用到 Perl、iconv、Perl DBI module,並先確保 WP 執行正常

  • How-to


1.將 BBS 上的個人版打包,會得到 uudecode 過的檔案,或是 tarball,解壓縮至 ~/tmp/

tar zxvf P_Socrates.tgz -C ~/tmp/(以個人版 P_Socrates 為例)

2.進入看板目錄 cd ~/tmp/brd/P_Socrates

3.利用 iconv 或其他程式將文章轉成 UTF8 格式,或是利用這個 Script(需要 iconv) 將文章轉換成 UTF8 格式,並且移至 allpost 資料夾。若自行轉換也請將文章移至同一個資料夾。

4.下載這個 Perl 程式 ,依據個人伺服器,修改其設定:

############ User Settings ###############
$host="localhost"; # Database Server IP or hostname
$db_name="test_blog"; # WordPress Database
$db_user_name="root"; # Database User Name
$db_password=""; # Database Password
$article_dir="allpost"; # BBS articles directory
$empty_file_dir="./empty_file"; # Empty articles will move to this directory
$blog_user_name="Socrates"; # Blog Author, it should be the same with BBS User name
$no_cat="未分類"; # Uncategory articles
################## END ####################

注意事項:匯入前請先確認 WP 已存在與版主相同名稱之使用者。建議先將文章匯入測試的資料庫,避免意外。

  • 匯入規則:


1.作者為版主發表之文章還有此主題的回覆文章

2.非版主發起之文章,但版主有回覆,以版主回覆當作新文章

3.將文章標題內 [XX] 當作分類

4.推文與回覆文(Re:) 皆當作「回應」

  • 其他


1.本程式未讀取 .DIR,可以方便修改適用其他 BBS 系統,也因此未分辨隱文或 m 文,需手動調整

2.文章斷行未特別處理,在 WP 某些 Theme 之下寬度不足,排版會亂掉

3.程式還有很多可以改進的地方 >////<

沒有留言: