vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   WebBBS to vBulletin 2.2.x Conversion Script (https://vborg.vbsupport.ru/showthread.php?t=35697)

Paul 03-03-2002 10:00 PM

WebBBS to vBulletin 2.2.x Conversion Script
 
Hello all!

After much painstaking oogling at php code, I've created a conversion script to convert WebBBS messages to vBulletin. I created this a bit ago, but feel that it might be of use to someone out there so I thought I'd share it.

This was written to convert from a very old version of WebBBS (circa 1998), but has since been modified to work with 5.0. It should be a good start for anyone out there wanting to do this.

All of the instructions are included in the file as comments. Read them carefully! When finished, don't forget to update counters and the search table.

Anticipating vB3 like you wouldn't believe,
Paul

Update:
  • Now corrects for GMT offset for older WebBBS versions (the newest versions use unix timestamps, so this isn't needed)
  • Situation where extra carriage returns were being added should now be resolved.
  • Link URLs and Images are now processed. URLs/Images in the actual message body (assuming you had HTML enabled on WebBBS) are not processed. Anyone willing to add this functionality, let me know.
  • Situation where certain date strings would offset the timestamp incorrectly has now been corrected.
  • Connection to the database is now handled much more efficiently.

NOTE: By downloading this, you agree that you will not send me countless PMs/e-mails asking for help with it. If you have a question, post it on this thread. I am by no means an expert. This is my first script in php. It was written to fill my need and may or may not fill yours. I do not have the time nor resources to provide support for it.

Also, as with all hacks on this site, this script is for registered vBulletin users ONLY. You are not permitted to distribute this script to anyone, under any circumstances.

TheComputerGuy 03-04-2002 08:28 AM

Three round of applause for Paul!!!!!!

Man you just dont know how much I Love ya!

Paul 03-04-2002 11:28 AM

Please let me know how it works out :)

TheComputerGuy 03-05-2002 12:57 PM

I will, and I soon will know, in about another week, after we buy another vB license

Paul 03-05-2002 02:20 PM

If you're buying a license on the premise that this will work for you, I'd suggest trying it out with the "light" version that is freely downloadable from vbulletin.com. I have no idea what the database structure is compared to the full version or if it would matter (although I sincerely doubt it since the conversion doesn't insert any thing special.. just the basics (nick, ip address, e-mail, etc..)). Just remember, there are no guarantees that it will work. I'd hate to see you spend up to $160 only to find out it's not suitable for you.

TheComputerGuy 03-09-2002 09:07 AM

I get some parase error on line 79 which is the local host line and nothing has changed......any ideas

Paul 03-09-2002 12:40 PM

Have you tried re-downloading the script? Perhaps there's a missing semicolon or something silly like that?
Are you using php3 or 4? I wrote it using four, although I don't know if it's compatible with 3.

TheComputerGuy 03-09-2002 02:27 PM

I am using php 4, I test the script out and I see it will work, but I have the board in a cgi-bin folder, and I keep getting a forbidden error on there, will I have to remove permissions off the file or such?

Paul 04-08-2002 06:43 PM

The script should be using the nobody account (assuming that's what apache is using) and therefore should have read access to anything that webbbs has access to. If you want to make sure, you can move the messages into a different folder or make a copy of them and change the permissions.. the script doesn't edit the message files.. it simply reads them and imports relevent values into the vb database.

Sorry it's taken me so long to respond... have you had any success with this?

Paul 05-03-2002 04:35 PM

Anyone interested in this conversion script:

It is not functioning due to a few syntax errors. I added a few variables that were formerly hardcoded into the script before posting it here and did not test the script prior to that as I had already completed my install. There are a few problems to note as well.... This script will NOT convert the timestamps on your messages to GMT, therefore messages may be off a number of hours when viewed in vB.. I have since written a script to correct for that error, but it is in no way in any condition to handle this problem for other users. Some points to consider: daylight saving time, your time zone, etc.

I will post an updated version of the conversion script later today that will hopefully fix the runtime errors.

Paul

Paul 08-09-2002 03:51 AM

Updated the original attachment to what I believe is a working version.

voclain 08-21-2002 07:12 PM

.....HERE's WHAT IT Looks like after I activate the script in my browser:

Script Version 1.04r
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfullyQuery failed inserting post

Yours,

Kirk Voclain

Paul 08-21-2002 07:17 PM

Quote:

Originally posted by voclain
.....HERE's WHAT IT Looks like after I activate the script in my browser:

Script Version 1.04r
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfullyQuery failed inserting post

Did you make sure to edit the following part of the file?:

PHP Code:

// Server: Change this the server your mySQL database is on.
$server "localhost";

// Sqldatabase: Change this to the name of the database on your server that vBulletin is on
$sqldatabase "vbulletin";

// Sqluserid: Change this to the username for your mySQL server database
$sqluserid "username";

// Sqlpassword: Change this to your password for your mySQL server database
$sqlpassword "password"

Make sure your database name, SQL username, and SQL password are all correct. Use the same settings that vBulletin uses.

voclain 08-21-2002 07:23 PM

YEP!!

I did that. INFACT when I go the the MySQL data base and look under Threads, IT posted ONE of the 25 I tryed to import. But that ONE does not show up on the Forum???

I'm sorry to say, I'm confused???

Yours,

Kirk Voclain

Paul 08-21-2002 07:30 PM

Have you specified the correct forumid?

voclain 08-21-2002 07:30 PM

Also:

Does it matter that the files in WebBBS look like this (I mean within the sequencial numbers):

SUBJECT>Re: This board is cool.
POSTER>Kirk Voclain
EMAIL>kirk@internet8.net
DATE>1021396575
IP_ADDRESS>64.165.69.139
PREVIOUS>5999
NEXT> 6008
IMAGE>http://www.pro4um.com/heli/rg.jpg
LINKNAME>The Pro4uM
LINKURL>http://www.pro4um.com
<P>This is a cool shot of my new helicopter.

I'm running version 5.00 of WebBBS. And version 2.2.6 of VB.

YOUR help is GREATLY appreciated!!!

Yours,

Kirk Voclain

voclain 08-21-2002 07:32 PM

YEP!!

And again in the data base, it lists it under the correct forum ID.

Yours,

Kirk

Paul 08-21-2002 07:34 PM

I have checked your web site and see that you are running webbbs 5.0. I did not design this conversion script for that version. Please post an two or three message files as attachments from your forum so we can look at the fields it's using and adjust the script to work for you.

Paul

voclain 08-21-2002 07:41 PM

Here are those file you requested. ALSO, when you go to my web site: http://www.pro4um.com well VB is not running there. I have VB set up and only working on an IP address.

MY HOST who currently has my site refused to upgrade his system to PHP and MySQL so I could use VB, so I'm switching.

IN THE process of swithching, I have not transfered the DNS yet, so VB is working, but only with an IP address.

I'm telling you all of this, to ask IF it matters or not???

LET ME KNOW and here are those files:

Kirk

Paul 08-21-2002 07:44 PM

Hah! While I was posting my response, you posted an example of one of the data files from your forum. It appears that your version of WebBBS uses unix timestamps instead of a string to specify the date, so that would cause my script to break. Try using the attached script and see if you get better results. Let me know how it works.

voclain 08-21-2002 07:53 PM

Paul:

LOOKS like it's doing the same thing:

Script Version 1.045t-WebBBS5.0x
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfullyQuery failed inserting post

AGAIN, your help is GREATLY APPRECIATED!!!

Yours,

Kirk Voclain

voclain 08-21-2002 08:06 PM

IT'S is also interesting to note that it does the first one??? When I go to the Data Base, it assignes the very first file (in this case number 157) to the data base. EVERYTHING is correct!! The threadid, title, lastpost, forumid, polit, open, replycount, postusername, postuserid, everything, even the originalid thing you had me add has the proper number in it: 157.

But when I go back to the forum, it does not show up???

NOW is it something to do with VB that is causing this???

AS I SAID, it's not 100% hooded up, I'm in the learning stages and getting it ready to swith the DNS stage.

I'm hoping I can just convert??? And then switch??? NOT have to switch and open my site up with an empty board???

ANYWAY again, THANKS FOR ALL OF YOUR HELP!! IT IS GREATLY APPRECIATED.

Kirk

Paul 08-21-2002 08:22 PM

I was just about to ask if you remembered to insert the originalid field. I actually messed up in the directions. :o You need to add the originalid field into both the thread and post tables. I've updated the instructions. Try the script attached after adding the additional originalid field to the post table so that you have an originalid in both post and thread.

Paul 08-21-2002 08:25 PM

Quote:

Originally posted by voclain
IT'S is also interesting to note that it does the first one??? When I go to the Data Base, it assignes the very first file (in this case number 157) to the data base. EVERYTHING is correct!! The threadid, title, lastpost, forumid, polit, open, replycount, postusername, postuserid, everything, even the originalid thing you had me add has the proper number in it: 157.
It might be a good idea to delete that entry. Also, after you've run the script, log into vBulletin's Admin CP and update all of the counters.

Paul 08-21-2002 08:28 PM

I also noticed on your site a lot of posts seem to have pictures attached. I didn't account for pictures or links in this conversion script, simply because there weren't that many on my posts. I'll try to add it into the script now.

voclain 08-21-2002 08:39 PM

Did it do something????

HERE is the message I got when I ran the latest thing you sent me:

Script Version 1.05t-WebBBS5.0x
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfullyQuery failed getting counts for forum: SELECT `replycount`,`threadcount` FROM `forum` WHERE forumid =

----------------

YOU HAVE NO IDEA how much I appreciate this!! I don't suppose you need a professional photographer for something??? OR an Adobe Photoshop GURU?? I am both and I would LOVE to repay the favor!!

Yours,

Kirk Voclain

voclain 08-21-2002 08:52 PM

Paul:

AS INFO, it did not work. I did an update of all counters in the admin. NOW when I go to the main board, it says there are 2 messages (used to only say one) but when you click on it, it still only shows ONE message.

So we are getting closer??? But it is still not working. PLUS it still only does ONE message, not all of them as intructed.

Yours,

Kirk

Paul 08-21-2002 08:54 PM

Quote:

Originally posted by voclain
Did it do something????

HERE is the message I got when I ran the latest thing you sent me:

Script Version 1.05t-WebBBS5.0x
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfullyQuery failed getting counts for forum: SELECT `replycount`,`threadcount` FROM `forum` WHERE forumid =

Alright.. we're getting there I suppose :) Thanks for the patience with this thing, as I've not tested it at all since I used it to convert 40,000 messages :)

Try the attached file. I added support for links and images since they seem to be used a lot in your forum. Hopefully, this will fix that error you got and not create any new ones! ;)

voclain 08-21-2002 08:59 PM

WE are getting close!!!

HERE is the latest message, IT LOOKS different???

Parse error: parse error in /home/virtual/site1/fst/var/www/html/cmc/bbs0/webbbs.php on line 285

LET ME KNOW...Thank you so much!!

Kirk

Paul 08-21-2002 09:05 PM

WHOOPS! :D

Forgot a silly little parenthesis. ;)

Try the attached version.

Paul 08-21-2002 09:15 PM

You've got me sitting on the edge of my seat... any luck? ;) I'll be away from the computer until late tonight (four-five hours) so I won't be able to help with any other problems until then. Let me know if it was successful for you. I've updated the original post on this thread with the latest version. You'll note I've added the $useunixtime variable in case there's anyone out there that needs the date processing I did with the old version I had. For 5.0, just leave it set to "1".

Paul

voclain 08-21-2002 09:34 PM

...... :D :D :D :D

Well sorry to tell you, the contractions are still there.

NEW PROBLEM:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/virtual/site1/fst/var/www/html/cmc/bbs0/webbbs.php on line 310


KEEP ME POSTED!!

Kirk

Paul 08-22-2002 02:28 AM

I always forget the little things ;) This time it was two periods ;)

Here's the updated file. Please work! ;)

voclain 08-22-2002 02:42 AM

GETTING CLOSER!!! This time it says this:

Script Version 1.09t-WebBBS
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfully
Query failed getting counts for forum: SELECT `replycount`,`threadcount` FROM `forum` WHERE forumid =

THANKS AGAIN!!

Kirk

Paul 08-22-2002 03:08 AM

Keep pushing.

Edit: Hah. I uploaded the same file as last time ;) Try again! :D

Paul 08-22-2002 03:13 AM

What a waste of a perfectly good thread :D

voclain 08-22-2002 03:20 AM

OK this looks promising!!! But still not working!!! I really would like to give birth to a boy or even a girl!!!

HERE's what it says:

Script Version 1.10t-WebBBS
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfully

Warning: Unable to jump to row 0 on MySQL result index 2 in /home/virtual/site1/fst/var/www/html/cmc/bbs0/webbbs.php on line 146

Warning: Unable to jump to row 0 on MySQL result index 2 in /home/virtual/site1/fst/var/www/html/cmc/bbs0/webbbs.php on line 147
Query failed updating forum counts: UPDATE forum SET replycount=, threadcount=, lastpost=-1, lastposter='Ralph Tomaccio' WHERE forumid = ''

Where are you from??? I'm going to owe you some family portraits or something when this is all over!!

Thank you so much!!!

Kirk Voclain

Paul 08-22-2002 03:31 AM

It's a girl:

voclain 08-22-2002 03:45 AM

IT's a girl??? But I don't think it human yet. But it definately has arms and legs!!!

OK, First here is the results of what happened, it's long, but here goes:

Script Version 1.11r-WebBBS
WebBBS-to-vBulletin 2.2 Message Converter

Connected successfully
Processed 157
Connected successfully
Processed 158
Connected successfully
Query failed inserting post: INSERT INTO `post` (`postid`, `threadid`, `username`, `userid`, `title`, `dateline`, `attachmentid`, `pagetext`, `allowsmilie`, `showsignature`, `ipaddress`, `iconid`, `visible`, `edituserid`, `editdate`, `originalid`) VALUES ('', '17', 'Rick McDaniel', '0', '4x5 view camera.', '-1', '0', 'You need the movements to keep the camera out of the reflections. You can do it as you suggested, if you do it well, but then the volume of shots you need to do it on, is significant, so that isn\'t really the best way. If you only had a handful to do, that might be a different story. 1. Dark gray paper 2. I would use a diffused spot, so the contrast reflected is reproducible. 3. Probably wouldn\'t use that technique. Since I don\'t Photoshop extensively, uncertain what might be best. 4. Edge reflections should be adequate with diffusion panels skimming the frames, with gobos to control the spill, and a light on either side. 5. Use hanging methods that keep the frame as flat to the wall as possible. If you use a hanger on each side, placed with a level for precision alignment, and group them by size, then you should be able to keep them fairly flat. Use spacers under the bottom edge, to tilt the base of the frame back up for top to bottom level. Use Polaroid or digital for previewing, to be certain everything is correct, before final exposure. Good luck. L'allure Photographic ', '1', '0', 'IP_ADDRESS>165.95.207.169', '0', '1', '0', '0', '159')


--


NOW the good news is that this is the first time that when I go back to my messages board on VB that I actually see more than just the test messages on the home page.

HOWEVER, when I click on the board, NOTHING is there except the test message that I put there previously.

I did an "update counters" but it did not fix the problem.

Thanks, can I at least send your wife some flowers or something?????????

Kirk

Paul 08-22-2002 03:56 AM

This time it's a girl. Like it or not. ;)

The ' in L'allure Photographic was what was messing it up. I had to rearrange some code, but this time it will work. ;) That's part of the code I added to include image and link attachments from WebBBS.

I also noticed that the format used in WebBBS 5.0 for storing the IP address has changed and have altered the code to account for that as well.

Hopefully we've thought of everything so far! :D


All times are GMT. The time now is 04:25 PM.

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.01299 seconds
  • Memory Usage 1,834KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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