Forums / Cotonti / Extensions / Support / PHPBB Converter

Update

jason
#1 2010-01-07 07:08
I'm updating the converter to work with phpBB v3.06 and Cotonti 0.6.5

The only problem I am having is the user passwords.
Recent versions of phpBB use Portable PHP password hashing framework.

Is there anyway to get the passwords to work properly in Cotonti?

Or is the only solution that users must reset their passwords?


Besides that, I'v updated the rest of the code and everything else is working great.
Will test for another day and then post the updated converter.
Trustmaster
#2 2010-01-07 17:04
One dirty trick is described here, but it requires everybody to log in.

Another option is hacking Cotonti to use phpbb_hash() instead of md5().
May the Source be with you!
Kilandor
#3 2010-01-07 18:00
Ah cool, nice work. Yea I forget what version I made that converter for.
Musashi
#4 2010-05-23 18:30
Hi there,

I have recently discovered Contonti, and I'm very impressed with the system. However, before I would migrate my current system, I would like to convert my PHPBB users and forum posts to Contonti.
I cannot seem to get the the converter working build by Kilandor, found here: http://www.cotonti.com/forums.php?m=posts&p=21042&highlight=PHPBB#21042
The PHP script gives no feedback (Page not found) when I enter the correct details in the config.php

I am using PHPBB 3.0.7 (PL1)

Jason mentioned he would post his updated version of the converter, is there any news on that?
Kilandor
#5 2010-05-24 21:30
Page not found would mean the file your trying to access doesn't exist or something of that sort.
Musashi
#6 2010-05-25 06:01
Hi Kilandor, thanks for your reply.

Sorry, I forgot to mention that indeed it would seem like I did something silly like enter the wrong URL, but this is not the case.
When I edit the config.php and make an error on purpose, (misspelled the MySQL user name) I get feedback fron your script:
A Database Connection/Select Problem was encountered, please check your config
Select Database Failed: Access denied for user 'ODBC'@'localhost' (using password: NO)
Select Database Failed: Access denied for user 'ODBC'@'localhost' (using password: NO)


Page created in 0.12418 seconds
Total SQL execution time 0 seconds
Average SQL execution time 0 seconds
SQL queries: 0PHP Notice: Undefined index: sqltotal in C:\Inetpub\wwwroot\contest\phpbbconv\index.php on line 417

I used the following config.php:
<?php

//Cotonti Database Information
$db_cot['host'] = 'localhost';	//Database Hostname
$db_cot['user'] = 'removed';	//Database Username
$db_cot['pass'] = 'removed';	//Database Password
$db_cot['name'] = 'cotonti';	//Database Name
$db_cot['pref'] = 'sed_';	//Database Prefix

//PHPBB Database Information
$db_old['host'] = 'localhost';	//Database Hostname
$db_old['user'] = 'removed';	//Database Username
$db_old['pass'] = 'removed';	//Database Password
$db_old['name'] = 'phpbb3';	//Database Name
$db_old['pref'] = 'phpbb_';	//Database Prefix

//This provides a simple warning the first time the script is ran to preven accidental run, and to provide a bit of info
//Incase readme was not read
$first_time_warning = TRUE;
?>
(Username and password removed)
When I correct the error I made in the username, there is a slight pause when I refresh the page, and I get the "Page not found" error.

Edit: Orignally your script had the database prefix lines commented out with the //
I changed that in the above example, no matter if I place it back or not, it doesn't change the outcome.

It may also be worth noting that even though the script says "access denied", it does wipe the sed_users table, locking me out of the clean Contonti database.
This post was edited by Musashi (2010-05-25 06:27, 13 years ago)
Kilandor
#7 2010-05-27 10:53
The prefix's are not used in the code.

It should always be outputting some data to see.

try replacing all "echo" with "$log_msg .="
And then on the line before "?>" at the end
Put "file_put_contents('log.txt', $log_msg);"

And see what the file contains.
Musashi
#8 2010-05-28 14:03
I restored the two profix's by adding the // like it was before in config.php

I edited index.php and replaced all entries of "echo" with "$log_msg .="

At the end of the file I added the line as show in the following fragment of the code:
list($usec, $sec) = explode(" ", microtime());
	$time['end'] = $usec + $sec;
	@$time['sqlavg'] = $time['sqltotal'] / $time['sqlqueries'];
	$log_msg .= '<br /><br />'.sprintf('Page created in %s seconds', round(($time['end'] - $time['start']), 5)).'<br />'.sprintf('Total SQL execution time %s seconds', round($time['sqltotal'], 5)).'<br />'.sprintf('Average SQL execution time %s seconds', $time['sqlqueries']).'<br />'.sprintf('SQL queries: %s', round($time['sqlavg'], 5));
	file_put_contents('log.txt', $log_msg);


I have no feedback on the browser screen after these changes, however: log.txt is being created filled with HTML text containing the same line over and over for pretty much all my current PHPBB users:

sed_users Insert: Field 'user_text' doesn't have a default value

When I make an error in the config.php I get the following screen output:
PHP Notice: Undefined variable: log_msg in C:\Inetpub\wwwroot\contest\phpbbconv\index.php on line 24 PHP Notice: Undefined index: sqltotal in C:\Inetpub\wwwroot\contest\phpbbconv\index.php on line 417

...and the log.txt file (which I erased before retrying) contains a single line telling me there is a problem with accessing the SQL database.

I looked up the sed_users table using Navicat, and the user_text field is a "Text" type. I noticed that the field didn't have "Allow Null" enabled, which I changed.

Now the script is converting users without passwords (Crawler Bot users), but skipping all real users with the following error:

sed_users Insert: Data too long for column 'user_password' at row 1

So I extended the varchar of the user_password to support 255 characters, which converted all user, but they passwords don't work on the Contonti system.

No forum posts were converted after that. The log.txt file read:
Forum Structure Conversion
Structures Converted 0
"Conversion Stoped due to failure above" (sic)
This post was edited by Musashi (2010-05-28 17:51, 13 years ago)