Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

z0rglub wrote:
Chacmool wrote:

z0rglub: Would be great if you could try this one. The guest-id-problem should be solved... hopefully :P

Too late, I converted my IPB 1.1 forum to punBB 1.1.3. See PhpWebGallery forum :-)

Hehe, okay :) Did you use the old phpbb-converter then? Was all the anonymous/guest-posts/topics converted properly?

52 (edited by z0rglub 2004-04-18 12:44)

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

Yes I used it ! Guest posts were not converted properly, I did modify the converter this way :

diff -ru ../phpbb_to_pubb/_posts.php /home/z0rglub/work/www/phpbb_to_pubb/_posts.php
--- ../phpbb_to_pubb/_posts.php Mon Jan  5 19:36:42 2004
+++ /home/z0rglub/work/www/phpbb_to_pubb/_posts.php     Sat Apr 17 12:19:20 2004
@@ -1,7 +1,7 @@
 <?^M
        $start = (int)$_GET['posts'];^M
        echo "\n<br>Converting posts: $start...<br>"; flush();^M
-       $result = mysql_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'].'posts AS post, '.$_SESSION['php'].'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 die(error("Unable to get posts", __FILE__, __LINE__, mysql_error(), "true"));^M
+       $result = mysql_query('SELECT post.post_id, post.post_time, post.poster_id, post.poster_ip, post.topic_id, text.post_subject, text.post_text, post.post_username, users.username FROM '.$_SESSION['php'].'posts AS post, '.$_SESSION['php'].'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 die(error("Unable to get posts", __FILE__, __LINE__, mysql_error(), "true"));^M
        $last_id;^M
        while($ob = mysql_fetch_assoc($result)){^M
                //printr($ob);          ^M
@@ -9,16 +9,25 @@
                echo $ob['post_id'].' ('.$ob['username'].")<br>\n"; flush();^M
 ^M
                // Save to database^M
-               mysql_query('INSERT INTO '.$_SESSION['pun'].'posts^M
-                       (id, poster, poster_id, posted, poster_ip, message, topic_id) VALUES(^M
-                       \''.$ob['post_id'].'\',^M
-                       \''.html_stuff($ob['username']).'\',^M
-                       \''.$ob['poster_id'].'\',^M
-                       \''.$ob['post_time'].'\',^M
-                       \''.decode_ip($ob['poster_ip']).'\',^M
-                       \''.convert_posts($ob['post_text']).'\',^M
-                       \''.$ob['topic_id'].'\'^M
-                       )') or die(error("PunBB: Unable to save post<br>", __FILE__, __LINE__, mysql_error(), "true"));^M
+               $query = 'INSERT INTO '.$_SESSION['pun'].'posts';^M
+               $query.= '(id, poster, poster_id, posted, poster_ip, message, topic_id) VALUES(';^M
+               $query.= "'".$ob['post_id']."',";^M
+               if ( $ob['poster_id'] != -1 )^M
+               {^M
+                 $query.= "'".html_stuff($ob['username'])."',";^M
+                 $query.= "'".$ob['poster_id']."',";^M
+               }^M
+               else^M
+               {^M
+                 $query.= "'".addslashes( $ob['post_username'] )."',";^M
+                 $query.= '1,';^M
+               }^M
+               $query.= "'".$ob['post_time']."',";^M
+               $query.= "'".decode_ip($ob['poster_ip'])."',";^M
+               $query.= "'".convert_posts($ob['post_text'])."',";^M
+               $query.= "'".$ob['topic_id']."'";^M
+               $query.= ');';^M
+                mysql_query( $query ) or die(error("PunBB: Unable to save post<br>", __FILE__, __LINE__, mysql_error(), "true"));^M
        }^M
 ^M
        // More topics?^M
@@ -27,4 +36,4 @@
                $location = '<script type="text/javascript">window.location="index.php?page='.$_GET['page'].'&posts='.$last_id.'"</script>';^M
        else^M
                $location = '<script type="text/javascript">window.location="index.php?page='.++$_GET['page'].'"</script>';^M
-?>
\ No newline at end of file
+?>^M
diff -ru ../phpbb_to_pubb/_topics.php /home/z0rglub/work/www/phpbb_to_pubb/_topics.php
--- ../phpbb_to_pubb/_topics.php        Mon Jan  5 21:03:18 2004
+++ /home/z0rglub/work/www/phpbb_to_pubb/_topics.php    Sat Apr 17 00:29:11 2004
@@ -17,6 +17,17 @@
                        $last['poster'] = $ob['username'];^M
                }^M
 ^M
+                if ( $ob['topic_poster'] == -1 )^M
+               {^M
+                 $query = 'SELECT post_username';^M
+                 $query.= ' FROM '.$_SESSION['php'].'posts';^M
+                 $query.= ' WHERE post_id = '.$ob['topic_first_post_id'];^M
+                 $query.= ';';^M
+                 $result = mysql_query( $query ) or die( error( 'Unable to retrieve first anonymous username to this topic', __FILE__, __LINE__, mysql_error(), "true" ) );^M
+                 $row = mysql_fetch_array( $result );^M
+                 $ob['username'] = $row['post_username'];^M
+               }^M
+^M
                // Save to database^M
                mysql_query('INSERT INTO '.$_SESSION['pun'].'topics^M
                        (id, poster, subject, posted, num_views, num_replies, last_post, last_post_id, last_poster, sticky, closed, forum_id) VALUES(^M
@@ -55,4 +66,4 @@
                $location = '<script type="text/javascript">window.location="index.php?page='.$_GET['page'].'&topics='.$last_id.'"</script>';^M
        else^M
                $location = '<script type="text/javascript">window.location="index.php?page='.++$_GET['page'].'"</script>';^M
-?>
\ No newline at end of file
+?>^M

PS : if you don't find this clear, copy past this text to a file named diff_converter_z0rglub.diff and open it with vim (:syntax on)

53 (edited by Shiva 2004-04-18 23:05)

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

I'm a newbie with punBB coming from WebBBS, then phpBB...

My questions:

1) I have a conversion from WebBBS to pphBB. Using the Converter: PhpBB2 -> PunBB1.1 there is a setting screen:

Host: localhost
PunBB database: 
PunBB prefix: 
PhpBB database: 
PhpBB prefix:

Does this work with database connection or dump files? If it works with database connection: Must phpBB have the same password as PunBB?

2) If I start the converter I get the following error:

"Error: Unable to truncate table.TRUNCATE TABLE my_punbb.punbb_polls."

By the way: Is there an easy way to convert WebBBS to punBB?

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

1) The databases must be on the same computer, and at the same "database-account". It does not work on dump-files.


2)Oh, sorry, my mistake.

Change line 21 in _start.php to:

@$db->query($sql);

I'm uploading a new ver to punres when it's up again.

55

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

Thank you for the fast answer!

Now everything works fine.

56

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

Is there a way to reverse this convertor?

57

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

punres is down sad

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

Meilad wrote:

Is there a way to reverse this convertor?

No, there's not. You have to do a converter yourself if you want to change back. There's some converters at the PhpBB-download-page, but I don't think there's one for PunBB yet.

stewy wrote:

punres is down :(

Yeah, I know... I can upload the files to another server when I'm home if you like.

59

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

that would be great, or if the files aren't too big, you can send it to me via email.

Thanks a lot!

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

stewy wrote:

that would be great, or if the files aren't too big, you can send it to me via email.

Thanks a lot!

I've put them here instead.

61

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

thats great!

thanks a lot!

62 (edited by stewy 2004-05-08 18:04)

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

Just figured I'd drop back and let you know the conversion went pefectly! I never encountered a problem at all.

If you want to check out the results you can take a look i posted a link in the show off forum here:

http://punbb.org/forums/viewtopic.php?pid=13489#13489

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

stewy wrote:

Just figured I'd drop back and let you know the conversion went pefectly! I never encountered a problem at all.

If you want to check out the results you can take a look i posted a link in the show off forum here:

http://punbb.org/forums/viewtopic.php?pid=13489#13489

Ahh, great! :) More PunBB to the people! :P

64 (edited by ardoi 2004-07-04 15:54)

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

One problem : Names

"ok no code tags then .... also a bug I think, gone report this."

The first is the name, the second is what ends up in the db after the conversion. People are unable to login with there accounts so I needed to edit there name as a admin befor they could login.

Solution : don't convert symboles in names to html wink

thx for the script I would have hated to lose all posts and members account's

Edit : Took out the code tags

What happens is that names that have symbols in them are changed to the html code for the symbol. things like !, $, ....

Linux is like a wigwam. No windows. No gates. Just an Apache inside.

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

ardoi wrote:

One problem : Names

"ok no code tags then .... also a bug I think, gone report this."

The first is the name, the second is what ends up in the db after the conversion. People are unable to login with there accounts so I needed to edit there name as a admin befor they could login.

Solution : don't convert symboles in names to html ;)

thx for the script I would have hated to lose all posts and members account's

Edit : Took out the code tags

What happens is that names that have symbols in them are changed to the html code for the symbol. things like !, $, ....

Which version do you use? There should be no problem in 2.0 as I use addslashes and not htmlspecialchars.

66

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

All perfect for me ... BUT ...

Connecté en tant que Rod.
Dernière visite: 01-01-1970 02:00:00

My forum
http://www.sortons.net/forum (perfect conversion, but ... THIS DATE sad)

67

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

OK ... All Marked Topics for the first time and hop ... PERFECT smile

68 (edited by lebel 2004-07-21 08:14)

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

script only for little database ...

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

lebel wrote:

script only for little database ...

Huh?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

70

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

I had more than 300.000 posts (250Mo for the database) and the script time out with apache since 30 minutes ...

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

Aha. I haven't actually tested the converter, but I imagined it would refresh the page now and then to prevent it from timing out. I do that in admin/maintenance when rebuilding the search index.

Chacmool: You don't do that?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

72

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

If you don't want to have a Time Out, do your conversion with Mozilla or Firefox (which don't know the notion of Time Out)

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

lebel wrote:

I had more than 300.000 posts (250Mo for the database) and the script time out with apache since 30 minutes ...

Okay, it should not do that... At which part does it tomeout? I assume it's the post-conversion... though, it should not be a problem.

I've never tried converting a forum with 300'000 posts myself (I don't have anyone to test with).

Rickard wrote:

Aha. I haven't actually tested the converter, but I imagined it would refresh the page now and then to prevent it from timing out. I do that in admin/maintenance when rebuilding the search index.

Chacmool: You don't do that?

Yes, I do.

Rod wrote:

If you don't want to have a Time Out, do your conversion with Mozilla or Firefox (which don't know the notion of Time Out)

Nice forum! Added it to punbbig, it's at pos #8 now :)

74 (edited by farhan 2004-07-24 16:01)

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

*sorry* just got the answer from the above posts

Re: Converter: PhpBB2 -> PunBB1.1 v2.0b3

Large up Chacmool,

It worked like a charm - thank you very much...

LBM.