Simple Machines Community Forum

SMF Support => Converting to SMF => Topic started by: Mike Bobbitt on April 29, 2004, 06:32:01 PM

Title: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on April 29, 2004, 06:32:01 PM
Hi all,

[Edited now that there's a download available]

I've written a script to convert UBB.Classic data (from the UBB exporter addd in 6.7.1) into SMF. You can download the script from:

http://perl.bobbitt.ca/ubb_to_smf/

If you give it a shot and have troubles, just let me know.
Title: Re: UBB Converter?
Post by: Ben_S on April 29, 2004, 06:42:27 PM
What you could do for now is try converting to phpbb then to SMF.
Title: Re: UBB Converter -- PROTOTYPE
Post by: Mike Bobbitt on May 04, 2004, 03:23:29 PM
Ok, I have a very rough prototype. I think it still has some issues to work out, but if anyone is willing to test it, I'd love the feedback:

http://perl.bobbitt.ca/ubb_to_smf/


Thanks
Title: Re: UBB Converter (Prototype now available)
Post by: Oldiesmann on May 04, 2004, 10:46:09 PM
If I had access to a free copy of UBB, I'd try that out, but I'm not going to register for a "40 day trial" just to test out a convertor... One suggestion though - you should probably put a note up saying that that's for UBB Classic and not the php-based UBB Threads. This is just to clear up any confusion that people might have since there are two different versions of UBB now.
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on May 05, 2004, 10:52:16 AM
Thanks, good point. :) Yeah, I wouldn't expect anyone to build a forum just to test it out. If anyone does give it a shot, I'd be curious to hear your results. I managed to convert ~3000 users and 70,000 posts and so far all looks well. Still, lots of room for problems. :)


Cheers
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on May 06, 2004, 07:32:04 PM
Well, that may have been a bit premature... Everything converted ok, but the board is acting funny. Notably:

1. You can't post a new topic. You get:

You have an error in your SQL syntax near ')' at line 4
File: /home/bobbitt/www/army/forums/Sources/Post.php
Line: 1121


2. You can reply to an existing topic, but it won't show up in the forum until you check for (and fix) errors. The reply is there and can be viewed, it just won't "register" in the forum until this is done.

I suspect this is all because I'm converting topic/post IDs from UBB. They don't start at 1, and there are gaps in the numbers. Anyone know why that might be a problem, or if that's even it?


Thanks
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: [Unknown] on May 06, 2004, 09:43:16 PM
They must start at 1... you *cannot* have a topic or board with an id of 0.

-[Unknown]
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on May 06, 2004, 10:01:14 PM
Ok, that's good to know... What about starting at a number > 1? Also bad?
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: [Unknown] on May 06, 2004, 10:22:23 PM
Nope, that's fine.  Missing numbers are okay too, as long as they are all above 0.

-[Unknown]
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on May 07, 2004, 02:30:06 PM
Ok, I have more info on what's happening now... Hopefully someone can shed some light on *why* it's happening.

After a conversion, new posts are inserted into the messages table with an  ID_TOPIC of 0. This causes the next call of db_insert_id to return a value of -1693997287, which is clearly wrong.

This in turn causes the new topic not to have an entry in the topics table since the return value of db_insert_id is negative, that insert is skipped.

I found this about mysql_insert_id:

Quotemysql_insert_id() converts the return type of the native MySQL C API function mysql_insert_id() to a type of long (named int in PHP). If your AUTO_INCREMENT column has a column type of BIGINT, the value returned by mysql_insert_id()  will be incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID() in an SQL query.

Since the topic ID fields are medium int, but mysql_insert_id returns int, will that cause a problem?

Or better yet, what have I done wrong! Why is the initial entry in the messages table inserting with a zero ID_TOPIC?


Thanks in advance for any help!
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Grudge on May 07, 2004, 03:20:30 PM
You you definetly BOTH deleteing and truncating the contents of the table before you try and do any inserts? It may have messed up the next insert ID number and hence isn't giving you one...
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: [Unknown] on May 07, 2004, 03:31:57 PM
Actually, only TRUNCATE is needed but it's not in all versions of MySQL 3.23.x.

-[Unknown]
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on May 07, 2004, 03:36:06 PM
Aha! I do a "DELETE FROM [table name]" to clean out existing entries, and since some of my early tests created bogus keys, I think that's it!

Will test and let you know.

Thanks!!!
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on May 21, 2004, 09:41:22 PM
Well, it looks like even my cut down topic/message IDs are too big for SMF to handle... :( For example the highest message ID in my test data turns out to be 2600970007 (seemingly valid but apparently too large...)

I've updated the script to "convert" message IDs to smaller numbers, but checking for uniqueness has caused the script to take a lot longer to run.

Anyone have a good suggestion as to how to proceed here?

(For example, a fast way to correllate UBB message IDs with smaller SMF message IDs...)


Thanks
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Grudge on May 23, 2004, 04:15:02 PM
Personally - and I know this is going to be harder - I would just re-start the message ID's from scratch. Instead of using the old message ID's at all - just generate new ones. You'll have a much cleaner and more efficient database that way. The challange would be be inserting them in order as SMF sorts posts by ID_MSG and not time of post so they need to be in the correct order.

If it helps I've attached a possibly untested file for resorting ID_MSG's - it may help give you an idea of possible ways to do it - but I'd definetly start from scratch...

Note the file is from CVS which I hope Unknown won't mind me posting - oh well :/
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on May 23, 2004, 04:48:28 PM
Thanks Grudge, I just finished doing that exact thing. The script now has a "preprocess" mode where it renumbers all messages and topics starting from 1. It takes a while to run (because it's not very efficient) but once it's done, you can just convert the data straight in.

And the best part: it works. :)


Thanks
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Winters on September 28, 2004, 01:13:18 PM
Would this converter work with a UBB 6.2.1?
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on September 28, 2004, 01:26:11 PM
Does 6.2.1 have the importer/exporter? The conversion script relies heavily on having exported UBB info. Not sure which UBB release that was added in...
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Winters on September 28, 2004, 01:36:42 PM
I have no idea, it's not my forum, but they said their UBB version is 4 years old. (Of course it gets hacked and has internal server errors all the time...)
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on September 28, 2004, 01:38:26 PM
Hmmm. I'm pretty sure it was added more recently than 4 years ago, so there may not be much I can do to help here... Sorry...
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Winters on September 28, 2004, 01:43:04 PM
Thanks... I'd be happy if I could get them to use ... er, another modern php based forum even (if there is a converter), but would prefer SMF, of course...
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: [Unknown] on September 28, 2004, 05:49:15 PM
Quote from: Winters on September 28, 2004, 01:43:04 PM
Thanks... I'd be happy if I could get them to use ... er, another modern php based forum even (if there is a converter), but would prefer SMF, of course...

Are you sure it's exactly that version (6.2.1)?  Could you get me a database dump - even if just structure and no data?

-[Unknown]
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Winters on October 05, 2004, 10:19:18 AM
That's what it says in the copyright footnote. Sadly, they have decided to upgrade with the company (forum hoster) they are with (and who, imho, have ripped them off).

If you still want it, I could ask them for the database, but I doubt that many other people still use that old version anyway.
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: gsbe on January 14, 2005, 03:31:37 AM
I am looking to convert Ultimate Bulletin Board 6.05 to SMF (embedded in Mambo). I will happily provide a database dump if you can help me. I'd really like to get away from this old board.

Gracias!
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on January 14, 2005, 07:36:00 AM
The converter is for UBB.Classic, which is the non-database version. I have no experience with the DB variant, sorry...

Feel free to use the script if the "import to SMF" portion helps though...
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: gsbe on January 14, 2005, 07:44:41 AM
Quote from: Mike Bobbitt on January 14, 2005, 07:36:00 AM
The converter is for UBB.Classic, which is the non-database version. I have no experience with the DB variant, sorry...

Feel free to use the script if the "import to SMF" portion helps though...
UBB 6.05 uses flat files, not a database.
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on January 21, 2005, 08:05:36 AM
Sorry, got distracted by the database dump comment... Does 6.05 have the importer/exporter? If so, you should be able to use the conversion script...
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: gsbe on January 21, 2005, 12:13:18 PM
Quote from: Mike Bobbitt on January 21, 2005, 08:05:36 AM
Sorry, got distracted by the database dump comment... Does 6.05 have the importer/exporter? If so, you should be able to use the conversion script...
Oh, sorry - I didn't mean database dump. Ugh...too many terms!

Where is the importer/exporter in UBB? I haen't seen one.
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on January 26, 2005, 02:46:31 PM
It should be in the CP. It's been so long I can't remember where exactly...

P.S. Sorry for the delay... my notifications were disabled somehow!
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: brnmllr on February 11, 2005, 08:42:37 AM
I am also interested in converting a UBB 6.05 board. There is not a export option that I can find.
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Mike Bobbitt on February 11, 2005, 09:01:00 AM
Sorry, the prototype script is based on export output, so it won't be much help for versions without it. :(
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: gsbe on July 13, 2005, 01:45:10 AM
I looked into this a bit recently and it seems that upgrading old versions of UBB to UBB.classic isn't too difficult:
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: R_Willis on April 11, 2006, 10:38:47 PM
I presume there is still no converter for older versions of UBB classic that do not have an import/export option in the user cp panel?

Upgrading to a version with it, is not an option for me either....

I'm running 5.45c if it matters.

Thanks!
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Sea Mac on February 09, 2012, 03:15:07 PM
I plan to try this.
your Import/Export function in UBB.Classic is at http//forums.root.folder/ubbcgi/cp.cgi?page=importexport In the control panel

Content Management:
Import/Export
Quote
   
The Import/Export tool allows you to export your data, and bring over data from other bulletin board products. 

Important Note: The import/export process may take up to three times your current disk space while it is working.  Please ensure you have enough space free before beginning. [/t][/t]
 Do you wish to import data, or export data?  
 
 
    Export Data
   Import Data
[/q]
I have the script - Thank You!
I only have one question. What version of SMF 1.x was this written for?


[/td][/tr][/table]
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Sea Mac on February 26, 2012, 02:37:49 PM
We gave the script a try ....

but it timed out ....
:'(

Well Annotated, but just won't work for larger forums. Now you know.
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Oldiesmann on March 05, 2012, 12:31:40 PM
This script likely won't work that well anyway, as SMF has changed a lot since it was written. It *might* work with 1.1, but that's just a guess as I don't remember what all changed between 1.0 and 1.1.
Title: Re: UBB.Classic Converter (Prototype now available)
Post by: Sea Mac on March 29, 2012, 11:17:25 PM
We have successfully upgraded to UBB.Threads 7 from UBB.Classic 6: so we don't care about this UBB.Classic to SMF converter any more.

We now care that the UBB.Threads Converter was written for SMF 1.0 and UBB.Threads 6.4 or 6.5 and won't work for SMF 2 and Any currently functioning Version of UBB.Threads.  We WILL be glad to donate a UBB.Threads 7.6 database Schema for you. We are interested in helping update the UBB.Threads converter. VERY Interested in fact,

We will be a SMF 2.0.2 forum as soon as we can: and we would like a little support getting there. We are quite willing to co-operate.



e