vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   phpBB2 Importer (https://vborg.vbsupport.ru/showthread.php?t=37135)

ZenithRS 07-22-2002 10:06 PM

Nebula... good work dude. I have a phpBB2 forum which I'm looking to convert over to vBulletin so decided to test your script out on a test server. The import worked fine with the exception of the following...

a) For some reason there was a post with a poll that caused it to crash out. The Jelsoft importer fell over at the same point. Once I deleted that post the import carried on successfully. I'm not sure why it was falling over, but the sql query it was executing was trying to select null id's.

b) Private Messages seem to have all imported OK, but just looking at my own in and out boxes there are quite a few that are identified with the wrong username. i.e. the message is meant for me but the from user displayed is incorrect. This is strange because some are in fact correct.?!?! This is not a biggie, as others have said I can just delete the PM's before import, but would be nice to see it work too :)

c) Avatars don't seem to be importing at all. No errors reported.

Again, good job. Keep it up :banana:

Cheers

Z

ZenithRS 07-23-2002 07:27 AM

I've worked out the problem with the Private Messages import. At some stage in the history of my phpBB2 I've deleted a user which left a gap in the sequence of userid's. In this case it was userid 18. The import script doesn't allow for this so phpbb userid 19 gets entered into the vbulletin as userid 18 as 18 is the next available spot...the field must be set to auto increment and the script doesn't "notice" the jump in phpbb's userid's.

I created a dummy user on the phpbb2, and then changed it's userid to 18 to fill in the gap in the sequence. Then ran the import script again. All the private messages are now associated with the correct user ids.

This explains why some had problems with the PM import while others didn't. I haven't delved into Nebula's code to find out why it does this, but I'm sure it will be a simple fix.

Hope this helps.

:banana:

Z

b.richards 07-23-2002 03:36 PM

Wow . I REALLY appreciate this script. Many blessings to you!

Chad Beattie 07-23-2002 07:53 PM

Quote:

Originally posted by ZenithRS
I've worked out the problem with the Private Messages import. At some stage in the history of my phpBB2 I've deleted a user which left a gap in the sequence of userid's. In this case it was userid 18. The import script doesn't allow for this so phpbb userid 19 gets entered into the vbulletin as userid 18 as 18 is the next available spot...the field must be set to auto increment and the script doesn't "notice" the jump in phpbb's userid's.

I created a dummy user on the phpbb2, and then changed it's userid to 18 to fill in the gap in the sequence. Then ran the import script again. All the private messages are now associated with the correct user ids.

This explains why some had problems with the PM import while others didn't. I haven't delved into Nebula's code to find out why it does this, but I'm sure it will be a simple fix.

Hope this helps.

:banana:

Z

Hmm. That helps a bit. I know I have created test users in the past and then deleted them. So that is probably why I am seeing this. Well, I hope you find it, that will be nice to get working. But really nothing to much to worry about. Now that you mention it, I don't think my avatars came across either. I was too busy trying to find the post it hung on and then also the PM issue that I didn't pay attention. Anyway, thanks for the info.

Scott MacVicar 07-25-2002 01:07 AM

An official phpBB2 importer has been released at http://www.vbulletin.com/members/

ZenithRS 07-25-2002 01:24 AM

Err.. yeah, but it's not as full featured as Nebula's, which I think was the point of this thread.

BTW, I've also come up with a small script that converts the quote="username" format of phpBB2 to vBulletin's standard format if anyone's interested in it. It's stand alone and can be run after the import.

Cheers

Z

Scott MacVicar 07-25-2002 02:04 PM

The one in the members area does Members, Forums, Threads and Polls

Chad Beattie 07-26-2002 03:33 PM

But still, I think you are missing the point. If you read through this thread you will see everyone that has used the official one thought it was horrible. I can vouch for that. I tried it first, and I was very dissapointed. I purchased vb a week back and my biggest concern was converting my phpBB board over to vb. I would have to say if the only thing available at the time was the offical convertor script, I would have been kicking and screaming to vb asking why they could call a script an 'official phpBB convertor' when it does a horrible job. The script posted here works great. Sure, a couple of things my have issues, but the end result of this script vs the official script is 1000 times better. To be honest, I would have not purchased vb if I had not found this thread. Reading how bad the official script is and what state it leaves your forums in, I would not have wasted my time. But I have to thank Nebula for putting in the time to do something correct. After reading how well his script works, and using it myself, I can now convert over with out any major issues.

Thanks :)

Chad Beattie 07-26-2002 03:35 PM

Quote:

Originally posted by ZenithRS
Err.. yeah, but it's not as full featured as Nebula's, which I think was the point of this thread.

BTW, I've also come up with a small script that converts the quote="username" format of phpBB2 to vBulletin's standard format if anyone's interested in it. It's stand alone and can be run after the import.

Cheers

Z

Yes, I am very interested in getting a copy of it. Can you post a copy.

Thanks.

ZenithRS 07-27-2002 12:11 AM

OK... but please please PLEASE backup your database before running this. I'm a builder, so my PHP skills are rudimentary at best. The script did run fine on my 2.2.6 vB.

Here's the code... just put it anywhere on your server and run it.

BACKUP YOUR DATABASE FIRST. This hasn't been tested anywhere other than on my solitary box. Your database is YOUR responsibility.

PHP Code:

<?
connectToDB();
$result=mysql_query("SELECT * FROM post WHERE pagetext LIKE '%[quote=%'");
while ($myrow=mysql_fetch_array($result)) {
    $temp="";
    echo "<b>Found [quote= in post id ".$myrow["postid"]."</b><br>\n";
    $post_string=$myrow["pagetext"];
    $post_string=str_replace("[/quote]","[/B][/QUOTE]",$post_string);
    while(substr_count($post_string,"[quote=\"")) {
        $position=strpos($post_string,"[quote=\"");
        $temp[]=substr($post_string,0,$position+6);
        $temp[]="][i]Originally posted by ";
        $post_string=substr($post_string,$position+8,strlen($post_string));
        $temp[]=substr($post_string,0,strpos($post_string,"\""))." [/i]".chr(13).chr(10)."[B]";
        $post_string=substr($post_string,strpos($post_string,"\"")+2,strlen($post_string)-(strpos($post_string,"\"")+2));
        }
    $temp[]=$post_string;
    $new_post_string=implode("",$temp);
    $new_post_string=addslashes($new_post_string);
    $update_query="UPDATE post SET pagetext='$new_post_string' WHERE postid=".$myrow["postid"];
    $update_result=mysql_query($update_query);
    if(!$update_result)
        die("Couldn't update: ".mysql_error())."<br><br>";
    echo "Post updated successfully... <p>";
    }
echo "SCRIPT COMPLETED";

function connectToDB()
  {
  $link=mysql_connect("dbserver","username","password");
  if(!$link)
    die("Couldn't connect to MySQL");
  mysql_select_db("dbname",$link)
    or die ("Couldn't open forum: ".mysql_error());
  }
?>

Obviously change the database information in the connectToDB function, including the dbname in the mysql_select_db statement.

Hope it works OK.

Cheers

Z


All times are GMT. The time now is 10:26 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01191 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete