1 頁 (共 1 頁)

[問題]請問如何把UltraBoard的資料庫轉過來?

發表於 : 2004-02-05 12:35
macchau
在各位大大的幫忙下 :-P ,小弟用了兩個月,終於建立了自己的phpBB forum,一切正常:
http://go2nature.net/forum.html

問題是,我的舊UltraBoard forum有著非常寶貴的資料,放棄了實在可惜: :cry:
http://go2nature.net/cgi-bin/UltraBoard/UltraBoard.pl

請問: 有沒有簡單的方法(例如php script)可以把UltraBoard的資料庫(存在個別的*.post文件裡)轉至phpBB的MySQL資料庫裡面呢?

(version)
UltraBoard 1.62.5 >>> phpBB 2.0.6

發表於 : 2004-02-05 15:53
bu
看有沒有方法用間接的方法轉移 ^^"
ex:
若 LB --> phpBB2
就用 LB-->VBB-->phpBB2

您的應也可以這樣動作
找找看您 UltraBoard 有無轉換到 phpBB 可轉換的論壇系統
再轉到... phpBB

發表於 : 2004-02-05 17:00
macchau
這也是方法之一,讓我找找看. ;)

發表於 : 2004-02-05 18:18
StickyKid

發表於 : 2004-02-06 21:52
macchau
Thanks,StickyKid.
很可惜沒有直接的方法...唯有花多點時間吧!:(

發表於 : 2004-02-17 14:03
macchau
終於給我找到UltraBoard >>> phpBB的script.
如果需要請PM我,我樂意與你分享. ;)

發表於 : 2004-02-17 14:04
Martinet
恭喜你:D
\n不過...貼在版面上大家一起分享不是更好嗎;)

發表於 : 2004-02-17 21:28
macchau
我開心得太早了.

原來所找到的script乃 UltraBoard 1.62 轉至phpBB 1.2.0的. 如下:
[php]<?php
if($submit) {
include('extention.inc');
include('functions.'.$phpEx);
include('config.'.$phpEx);
require('auth.'.$phpEx);

if ($delete == "on"){
$sql = "delete from topics where forum_id = $forum";
if (!mysql_query($sql, $db))
echo "cannot clean up topics";
$sql = "delete from posts where forum_id = $forum";
if (!mysql_query($sql, $db))
echo "cannot clean up topics";
echo "DB cleared<BR>";
}


while ($post < $postend) {
if (!$fp = fopen ("$dir/$post.post","r")) {
echo "$post.post not exist<BR>";
} else {
$count = 0;
while (!feof ($fp)) {
$oldrecord = explode("|^|",fgets($fp, 4096));
if ($count == 0)
{
$sql = "INSERT INTO topics (topic_title, topic_poster, forum_id, topic_time, topic_notify,unregistered_name) VALUES (".
"'".addslashes(str_replace("|APO|","''",str_replace("|EQU|","",str_replace ("+", " ", $oldrecord[0]))))."',".
"'-1', ".
"'$forum', ".
"'".date("Y-m-d H:i",$oldrecord[5])."',".
"'0',".
"'".str_replace("+"," ",$oldrecord[1])."')";

if(!$result = mysql_query($sql, $db)) {
echo "Couldn't enter topic in database.<BR>";
echo "$sql<BR>";
break;
}
$topic_id = mysql_insert_id();
}
if (!($count == 1)){
if (strlen($oldrecord[7]) > 0) {
$sql = "INSERT INTO posts (topic_id, forum_id, poster_id, post_text, post_time, poster_ip,unregistered_name) VALUES ('$topic_id', '$forum', '-1', '".str_replace ("+", " ", addslashes(str_replace("|APO|","''",str_replace("|EQU|","",str_replace("\\
","",$oldrecord[7])))))."', '".date("Y-m-d H:i",$oldrecord[5])."', '".$oldrecord[6]."','".str_replace("+"," ",$oldrecord[1])."')";
if(!$result = mysql_query($sql, $db)) {
echo "Couldn't enter post in database.<BR>";
echo "$sql<BR>";
}
}

}
$count++;

}
echo "#".$post." added<BR>";
}
$post++;
}
echo ($post-1)." topics added";
} else {
echo $submit;
?>
<form>

Forum ID : <input type = "TEXT" name = forum><BR>
Directory : <input type = "TEXT" name = dir><BR>
Start : <input type = "TEXT" name = post><BR>
End : <input type = "TEXT" name = postend><BR>
Clear DB? : <input type = "checkbox" name = delete><BR>
<input type = submit NAME="submit">
</form>
<?php
}
?>[/php]

經初步研究:
1)phpBB 1.2 祇會用以下table儲存留言資料:
- phpbb_topics
- phpbb_posts
而phpBB 2.0.6則用:
- phpbb_topics
- phpbb_posts
- phpbb_posts_text <--新增的
2)以上table的structure也不同,可以說是兩碼子事. :-(

我會嘗試把它改成 2.0.6可用,但已經遇到以下問題:
1) 舊phpbb_topics的"topic_notify"/"unregistered_name",現在該放那裡?
2) 舊phpbb_posts的"unregistered_name",現在該放那裡?
3) 新增的phpbb_posts_text的"bbcode_uid",我該放甚麼進去呢?

相信改完後,我會對2.0.6更了解... :-?

請問有沒有大大可以幫忙修改一下呢? :oops: