Topic: phpBB 3 to punbb convertor ?
Hello,
i'm searching a convertor for phpBB3, i found phpBB2 to punbb only
its doesn't exit ? or it's in project ?
(google don't want to help me )
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 discussion → phpBB 3 to punbb convertor ?
Hello,
i'm searching a convertor for phpBB3, i found phpBB2 to punbb only
its doesn't exit ? or it's in project ?
(google don't want to help me )
Try using the converter for phpBB2, post here if something doesn't work.
i have tried it ^^ its doesnt work
i have that : Table 'xxx.phpbb3_categories' doesn't exist (Errno: 1146)
for phpbb3 the more similar table is phpbb3_forum, if a rename this table the program cant correctly extract allinformations of this table, the next probleme is with phpbb3_post ; same problem
in finish when iam trying to see the forum, i can see the title of recents topic, but i cant see any categorie, forum, message
OK, then my best suggestion would be to convert to another forum system that the converter supports and then convert to PunBB.
you have a suggestion ?
because of the number of message (something like 5000) its no easy to change all table
convert to phpbb2 then convert your phpbb2 to punbb
sure ^^ its the best way, but i dont find a program who can do that ( only phpbb2.x to phpbb3.x )
have you a link for that ?
I doubt you'll find one. I meant to convert from phpBB 3 to, say, SMF, which PunBB can convert from.
fiu ^^ ok i look that thank you ^^
edit:
okay ... only convertor from phpBB2 humhum ^^
( this site is nice, http://www.simplemachines.org/download/?converters all converters for smf 1.1 )
OK, well lets see if I can fix the PunBB converter problems for you one at a time
In the phpBB folder, for categories.php
FIND
// Fetch forum info
$result = $fdb->query('SELECT * FROM '.$_SESSION['php'].$_SESSION['phpnuke'].'categories') or myerror('Unable to fetch categories', __FILE__, __LINE__, $fdb->error());
while($ob = $fdb->fetch_assoc($result))
{
echo $ob['cat_title'].' ('.$ob['cat_id'].")<br>\n"; flush();
// Dataarray
$todb = array(
'id' => $ob['cat_id'],
'cat_name' => $ob['cat_title'],
'disp_position' => $ob['cat_order'],
);
// Save data
insertdata('categories', $todb, __FILE__, __LINE__);
}
REPLACE WITH
// Fetch forum info
$result = $fdb->query('SELECT * FROM '.$_SESSION['php'].$_SESSION['phpnuke'].'forums where forum_type=0') or myerror('Unable to fetch categories', __FILE__, __LINE__, $fdb->error());
while($ob = $fdb->fetch_assoc($result))
{
echo $ob['forum_name'].' ('.$ob['forum_id'].")<br>\n"; flush();
// Dataarray
$todb = array(
'id' => $ob['forum_id'],
'cat_name' => $ob['forum_name'],
'disp_position' => $ob['left_id'],
);
// Save data
insertdata('categories', $todb, __FILE__, __LINE__);
}
woah ^^ ok i try it ...
the next problem is :
Table 'xxx.phpbb3_posts_text' doesn't exist (Errno: 1146)
( file: /converters/PhpBB/posts.php )
( i'am checking in the table if all categories havent been correctly created )
Wow amazing it's working, i can see all categories :pn only post are missing ^^)
OK!
phpBB folder, posts.php
FIND
$result = $fdb->query('SELECT post.post_id, post.post_time, post.poster_id, post.poster_ip, post.topic_id, text.post_subject, text.post_text, users.username FROM '.$_SESSION['php'].$_SESSION['phpnuke'].'posts AS post, '.$_SESSION['php'].$_SESSION['phpnuke'].'posts_text AS text, '.$_SESSION['php'].'users AS users WHERE post.post_id>'.$start.' AND post.post_id=text.post_id AND users.user_id=post.poster_id ORDER BY post.post_id LIMIT '.$_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
REPLACE WITH
$result = $fdb->query('SELECT post.post_id, post.post_time, post.poster_id, post.poster_ip, post.topic_id, post.post_subject, post.post_text, users.username FROM '.$_SESSION['php'].$_SESSION['phpnuke'].'posts AS post, '.$_SESSION['php'].'users AS users WHERE post.post_id>'.$start.' AND users.user_id=post.poster_id ORDER BY post.post_id LIMIT '.$_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
wow you are amazing ^^
ok i have tried it, all is working, all table are created, but no message connected to categorie (all information on punbb_post seems to be good )
( i'm trying 2, 3 thing on the forum ^^ )
ok its strange
i can see all message, if i click the link to see the categorie i see all message of this categorie, but the overview of all forum ... i cant see anyting ^^
interesting, on tables, when i looking punbb_forums, i can see, for all, 0 for cat_id
ok i found the problem, its something with phpbb3_forums
when a forum is transfered, the categories id is alway 0, (cat_id for punbb)
Oh
phpBB folder, forums.php
This is the new code:
<?php
// Fetch forum info
$result = $fdb->query('SELECT * FROM '.$_SESSION['php'].$_SESSION['phpnuke'].'forums WHERE forum_id>'.$start.' AND forum_type != 0 ORDER BY forum_id LIMIT '.$_SESSION['limit']) or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while($ob = $fdb->fetch_assoc($result))
{
$last_id = $ob['forum_id'];
echo $ob['forum_name'].' ('.$ob['forum_id'].")<br>\n"; flush();
// Check for anonymous poster id problem
$ob['forum_last_post_id'] == -1 ? $ob['forum_last_post_id'] = 1 : null;
// Fetch user info
$userres = $fdb->query('SELECT users.username, posts.post_time FROM '.$_SESSION['php'].'users AS users, '.$_SESSION['php'].$_SESSION['phpnuke'].'posts AS posts WHERE users.user_id=posts.poster_id AND posts.post_id='.$ob['forum_last_post_id']) or myerror("Unable to fetch user info for forum conversion.", __FILE__, __LINE__, $fdb->error());
$userinfo = $fdb->fetch_assoc($userres);
// Change last_post = 0 to null to prevent the time-bug.
$userinfo['post_time'] == 0 ? $userinfo['post_time'] = 'null' : null;
$ob['forum_last_post_id'] == 0 ? $ob['forum_last_post_id'] = 'null' : null;
// Unset variables
if(!isset($userinfo['username']))
$userinfo['username'] = 'null';
// Dataarray
$todb = array(
'id' => $ob['forum_id'],
'forum_name' => $ob['forum_name'],
'forum_desc' => $ob['forum_desc'],
'num_topics' => $ob['forum_topics'],
'num_posts' => $ob['forum_posts'],
'disp_position'=> $ob['forum_order'],
'last_poster' => $userinfo['username'],
'last_post_id' => $ob['forum_last_post_id'],
'last_post' => $userinfo['post_time'],
'cat_id' => $ob['parent_id'],
);
// Save data
insertdata('forums', $todb, __FILE__, __LINE__);
}
convredirect('forum_id', $_SESSION['phpnuke'].'forums', $last_id);
?>
lol you are fast
ok i tested ^^ all working, only one think, all subforum, are not present
maybe create a new categorie will be nice ? ^^
i see that for all forum of a "subforum" they have the same "cat_id" for punbb
Yeah, I was thinking about that: let me see what I can do
OK, new code for forums.php, this should put all subforums in their own category.
<?php
// Fetch forum info
$result = $fdb->query('SELECT * FROM '.$_SESSION['php'].$_SESSION['phpnuke'].'forums WHERE forum_id>'.$start.' AND forum_type != 0 ORDER BY forum_id LIMIT '.$_SESSION['limit']) or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while($ob = $fdb->fetch_assoc($result))
{
$last_id = $ob['forum_id'];
echo $ob['forum_name'].' ('.$ob['forum_id'].")<br>\n"; flush();
// Check for anonymous poster id problem
$ob['forum_last_post_id'] == -1 ? $ob['forum_last_post_id'] = 1 : null;
// Fetch user info
$userres = $fdb->query('SELECT users.username, posts.post_time FROM '.$_SESSION['php'].'users AS users, '.$_SESSION['php'].$_SESSION['phpnuke'].'posts AS posts WHERE users.user_id=posts.poster_id AND posts.post_id='.$ob['forum_last_post_id']) or myerror("Unable to fetch user info for forum conversion.", __FILE__, __LINE__, $fdb->error());
$userinfo = $fdb->fetch_assoc($userres);
// Change last_post = 0 to null to prevent the time-bug.
$userinfo['post_time'] == 0 ? $userinfo['post_time'] = 'null' : null;
$ob['forum_last_post_id'] == 0 ? $ob['forum_last_post_id'] = 'null' : null;
// Unset variables
if(!isset($userinfo['username']))
$userinfo['username'] = 'null';
// Dataarray
$todb = array(
'id' => $ob['forum_id'],
'forum_name' => $ob['forum_name'],
'forum_desc' => $ob['forum_desc'],
'num_topics' => $ob['forum_topics'],
'num_posts' => $ob['forum_posts'],
'disp_position'=> $ob['forum_order'],
'last_poster' => $userinfo['username'],
'last_post_id' => $ob['forum_last_post_id'],
'last_post' => $userinfo['post_time'],
'cat_id' => $ob['parent_id'],
);
// Save data
insertdata('forums', $todb, __FILE__, __LINE__);
}
// We move all subforums into a new category: they'll have to be properly organized by hand
$db->query('INSERT INTO '.$_SESSION['pun'].'categories (cat_name, disp_position) VALUES ("Subforums", 100)') or myerror('PunBB: Unable to create subforum category', __FILE__, __LINE__, $fdb->error());
$db->query('UPDATE '.$_SESSION['pun'].'forums AS f LEFT JOIN '.$_SESSION['pun'].'categories AS c ON (f.cat_id = c.id) SET f.cat_id = '.$db->insert_id().' WHERE c.id IS NULL') or myerror('PunBB: Unable to move subforums to new category', __FILE__, __LINE__, $fdb->error());
convredirect('forum_id', $_SESSION['phpnuke'].'forums', $last_id);
?>
ok i have tried, the missing forum are here, but now all forums are grouped in one categorie "subforum" ^^
I updated my code above, try now, see if it changed anything
hello,
i have tried your code, but the result is the same ^^ (on categorie "subforum" with all forums in )
Well, can you send me a dump of the phpBB forums table then? Obviously I'm not understanding how phpBB relates forums to categories.
ok i put on this forum later, iam very busy for moment i dont forget you
I get this error:
File: /homepages/36/d175509457/htdocs/shadow/punbb/converter/PhpBB/forums.php
Line: 41
Converter reported: Unable to save to database.
Query: INSERT INTO `xxxxxxxxxx`.PUNBB_forums (id,forum_name,forum_desc,num_topics,num_posts,last_poster,last_post_id,last_post,cat_id) VALUES('1','xxxxxxx','xxxxxxxxxxx','16','20','drndadoo','141','1187343698','17')
Database reported: Duplicate entry '1' for key 1 (Errno: 1062)
I'm not exactly sure how that's possible, since forum_id is a primary key for phpBB. Unless the converter isn't deleting the old PunBB data, which I've always seen it do, I don't know how that could happen.
PunBB Forums → PunBB 1.2 discussion → phpBB 3 to punbb convertor ?
Powered by PunBB, supported by Informer Technologies, Inc.