UBB 5.x to phpBB 2.x Converter

This is an archive of the phpBB 2.0.x convertors forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
GUI
Registered User
Posts: 65
Joined: Sat May 25, 2002 3:21 pm
Location: The padded room
Contact:

UBB 5.x to phpBB 2.x Converter

Post by GUI »

UBB 5.x to phpBB 2.x Converter

Download Installation
  1. Copy the "convert" folder to the root directory of your phpBB folder.
  2. Make the config.php file world writable/chmod 777.
  3. Point your browser to the url of the convert folder (ie. http://www.example.com/phpBB2/convert/), fill in the needed information, and hope for the best.
Additional Notes
  • For the time being, this script requires PHP > 4.0.4, due to the usage of PEAR DB. I might eventually make a switch to phpBB's database implementation since that seems to be more compatible.
  • Successfully converted versions (please let me know if you've converted others): 5.45c, 5.47a, 5.47d, 5.47e
  • A big thanks to Paul Daniels for the "incentive" to finish this converter and for all the initial beta testing.
  • If you run into any problems, debug mode may be turned on by changing the variable $debug from 'no' to 'yes' in prefs.php
  • As of version 1.0.4 sequences are updated for PostgreSQL. Other supported databases also use sequences, but I'm unaware of which ones. If your database uses also uses sequences, let me know and I will implement it into the converter.
Change Log
  • 1.1.0 (03-11-03)
    • Process is completely automated through auto-refreshing pages.
    • Time and convert limits may now be set on the index page.
    • Compatible with PHP running in safe mode (time limit will be set to PHP's configuration value).
    • Lots of other little bug fixes and enchancements.
  • 1.0.5 (03-03-03)
    • The search tables are now updated so the imported posts can be searched.
    • I wasn't able to replicate this with my version of UBB, but I believe that at some point, it was possible for users to input text for ICQ numbers in their profile, causing problems with phpBB's numeric column type for storing ICQ numbers. The converter now throws out anything other than numbers.
  • 1.0.4 (02-24-03)
    • UBB allows longer topic titles than phpBB. Topic titles are now trimmed to 60 characters.
    • Sequences in PostgreSQL are updated for post, topic, and category IDs.
  • 1.0.3 (02-22-03)
    • Converter now works with PostgreSQL and all other databases supported by PEAR DB.
    • Updated some SQL statements to adhere to PostgreSQL's stricter syntax.
    • Implemented better error handling. The error function now displays the SQL statement and a more detailed error.
    • Added error checks and rearranged the queries that retrieve next IDs.
    • I also realized that it's 2003, and not 2002. Oops. :oops: Updated changelog appropriately.
  • 1.0.2 (01-30-03)
    • Added daylight saving time options to fix timestamp problems in certain cases. Fixed other bug concerning timestamps. (Thanks AbelaJohnB)
  • 1.0.1 (01-25-03)
    • Fixed bug preventing members.php from converting more than 1000 members (Thanks CptanPanic)
  • 1.0.0 (01-24-03)
    • Initial Release
If you encounter any problems with this, just let me know.

Donations, although by no means necessary, are greatly appreciated!

Image
Last edited by GUI on Sun Sep 28, 2003 2:05 pm, edited 15 times in total.
Hard work may not kill you, but why take chances?
CptanPanic
Registered User
Posts: 43
Joined: Fri Jan 24, 2003 12:19 am

Post by CptanPanic »

This is great,
Can't wait to do it.
Thanks,
Bri
CptanPanic
Registered User
Posts: 43
Joined: Fri Jan 24, 2003 12:19 am

Post by CptanPanic »

I found a bug in the members.php which will mess up if you have more than 1000 members.

Line 77 Should be

Code: Select all

$tpl->assign ('form_submit', "members.php?start=$newstart");
it originally had single quotes, which meant the $newstart was taken literally.
GUI
Registered User
Posts: 65
Joined: Sat May 25, 2002 3:21 pm
Location: The padded room
Contact:

Post by GUI »

Thanks. :) It's now been fixed.
Hard work may not kill you, but why take chances?
Tobi
Registered User
Posts: 48
Joined: Sun Dec 30, 2001 11:44 pm
Location: Germany
Contact:

Post by Tobi »

Hi Gui,

the converter works fine. There is just a small bug I think! I could not sadly convert private forums ;(

Tobi
Tobi
Registered User
Posts: 48
Joined: Sun Dec 30, 2001 11:44 pm
Location: Germany
Contact:

Post by Tobi »

Hi,
Tobi wrote: the converter works fine. There is just a small bug I think! I could not sadly convert private forums ;(


stupid me, everything worked great. I was not logged in, so i could not see the private forums, sorry :oops:

Tobi
AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

Post by AbelaJohnB »

What sub-versions of 5.x does this work for?


In essance, if you've gotten this script to work, please post what sub-versions of UBB you were using :mrgreen:
Tobi
Registered User
Posts: 48
Joined: Sun Dec 30, 2001 11:44 pm
Location: Germany
Contact:

Post by Tobi »

Hi,
AbelaJohnB wrote: please post what sub-versions of UBB you were using :mrgreen:


it was an UBB 5.47d! Everything seems to be ok, but I will have a closer look for all post etc. tomorrow.

But I think the converter only works with PHP 4.2.2 (:?:)!

Tobi
Pagemakers Design
Registered User
Posts: 285
Joined: Fri Jan 10, 2003 12:10 am
Location: Manchester UK

Post by Pagemakers Design »

Works great on our board too.

Thanks Nick!
AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

Post by AbelaJohnB »

Ok, two small changes that I feel need to be made:

(1) At the end of the mktime() you really should add the optional 'day light saving times', with a value set to 0.

This did not affect us, but it c/should.

(2) There is an extra 'if' statement that is required, to properly handle the posts added late in the day.


In essance:

Code: Select all

OPEN: 

messages.php

FIND:

		if ($ampm == 'PM') {
			$hour = $hour + 12;
		} else if ($ampm == 'AM' && $hour == 12) {
			$hour = 0;
		}
		
		$post_time = mktime ($hour, $minute, 0, $month, $day, $year);

REPLACE, WITH:

		if ($ampm == 'PM' && $hour < 12) {
			$hour = $hour + 12;
		} else if ($ampm == 'AM' && $hour == 12) {
			$hour = 0;
		}
		
		// $post_time = mktime ($hour, $minute, 0, $month, $day, $year);
		$post_time = mktime ($hour, $minute, 0, $month, $day, $year, 0);

This has solved (we think) all oddities with incorrect date/time stamps.

Your milage may very....
Slapyo
Registered User
Posts: 29
Joined: Mon Jun 10, 2002 5:55 pm
Location: Rancho Cucamonga, CA
Contact:

Post by Slapyo »

i uploaded everything and CHMOD the config.php 777, i get the following errors when i goto the convert folder.

Code: Select all

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in DB.php on line 212

Fatal error: Class declarations may not be nested in class.TemplatePower.inc.php on line 39
i installed it to http://www.myserver.com/phpbb/convert/ and when i goto that address i get those errors. i dunno whats goin on cause everyone else seems to have no problems with it. this is also with debug turned on.
Tobi
Registered User
Posts: 48
Joined: Sun Dec 30, 2001 11:44 pm
Location: Germany
Contact:

Post by Tobi »

@Slapyo

Which PHP Version do you use?

Tobi
Slapyo
Registered User
Posts: 29
Joined: Mon Jun 10, 2002 5:55 pm
Location: Rancho Cucamonga, CA
Contact:

Post by Slapyo »

the server has PHP Version 4.0.3pl1
Slapyo
Registered User
Posts: 29
Joined: Mon Jun 10, 2002 5:55 pm
Location: Rancho Cucamonga, CA
Contact:

Post by Slapyo »

ok they upgraded the server to ver 4.2, not 4.3 but the script works. now i have a question. could someone fill me in on what i need to put into these categories???

cgi-bin scripts path:
Variable files path:
Members path:
NonCGI path:

examples would be great! :)
my message board is located in http://www.myserver.com/board/

sorry, i'm just not up on the whole cgi thing, i used to be but then i got into php and forgot pretty much everything.
GUI
Registered User
Posts: 65
Joined: Sat May 25, 2002 3:21 pm
Location: The padded room
Contact:

Post by GUI »

Thanks for doing all the work for me AbelaJohnB. :) I've updated it to 1.0.2 which includes a daylight saving time field on the configuration page where you can choose one of three options: "Automatic", "Yes", and "No." I think this should fix that problem.

It also appears as though PEAR DB will not work in any PHP < 4.0.4, so that's why you were having those initial problems, Slapyo. If I have some free time, I'll see about redoing the database calls to use phpBB's DB implementation, since that seems to have better compatibility.

I've also updated the Additional Notes section with some more info including a running list of versions of 5.x successfully converted. If you've converted one that isn't listed, please tell me.

Slapyo: those fields are for the absolute paths to the respective directories. If you're unsure what they are, head to the UBB control panel -> General Settings and its those first few paths on the page.
Hard work may not kill you, but why take chances?
Locked

Return to “[2.0.x] Convertors”