[SUPPORT] PunBB to phpBB convertor

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
SelinaK
Registered User
Posts: 5
Joined: Wed Apr 16, 2008 9:26 am

Re: [SUPPORT] PunBB to phpBB convertor

Post by SelinaK »

There might be a solution to the password problem.
I converted from punBB to phpBB2 and noticed the difference is pretty simple: the password column is varchar(32) in phpBB, varchar(40) in punBB. PhpBB uses md5, punBB md5 or sha1 depending on the PHP version (for 4.3.0+ it is sha1). So, after installing phpBB, I changed the password column from 32 length string to 40; then, in punbb/include/functions.php, I found the punbb_hash function, pretty short and simple:

Code: Select all

function pun_hash($str)
{
	if (function_exists('sha1'))	// Only in PHP 4.3.0+
		return sha1($str);
	else if (function_exists('mhash'))	// Only if Mhash library is loaded
		return bin2hex(mhash(MHASH_SHA1, $str));
	else
		return md5($str);
}
I put this in phpBB/login.php before this line (or I could put it to common.php or functions.php or wherever):

Code: Select all

if( md5($password) == $row['user_password'] && $row['user_active'] )
and then changed the line to

Code: Select all

if( pun_hash($password) == $row['user_password'] && $row['user_active'] )
Now I can login with my old password.
Well, it requires a slight modification of the phpBB code and database, but it is more acceptable for me than bugging all my users with the password recovery chaos...
margeryred
Registered User
Posts: 1
Joined: Sun Apr 20, 2008 12:07 am

Re: [SUPPORT] PunBB to phpBB convertor

Post by margeryred »

Wow... I am a web designer... well, I thought I was until I read all this...

I am not a program writer and this is all a little confusing.

I currently have a punbb message board for my police union...

I will need help doing the conversion, but I have changed web hosts and I am not sure if my current web host will transfer properly.

Anyway, can one of you help me with this conversion??? I don't feel confident to do this on my own...

Please help.

(I am not asking for this for free, I will compensate you for your time...)
op76
Registered User
Posts: 111
Joined: Thu Oct 10, 2002 11:01 pm
Location: Finland
Contact:

Re: [SUPPORT] PunBB to phpBB convertor

Post by op76 »

I'm a webmaster (some sort of), and I have asked to join phpBB2 forum and punBB. There are about 1500 users on phpbb with way over 100000 posts, and few thousand posts in punBB...is that a problem? Quick answer would be appreciated.
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] PunBB to phpBB convertor

Post by D¡cky »

op76 wrote:I'm a webmaster (some sort of), and I have asked to join phpBB2 forum and punBB. There are about 1500 users on phpbb with way over 100000 posts, and few thousand posts in punBB...is that a problem? Quick answer would be appreciated.
It is not a problem. First you convert PunBB to phpBB2, then you use the script in this post to merge the two phpBB forums.
Have you hugged someone today?
op76
Registered User
Posts: 111
Joined: Thu Oct 10, 2002 11:01 pm
Location: Finland
Contact:

Re: [SUPPORT] PunBB to phpBB convertor

Post by op76 »

What about passwords...will they work? Or if there's duplicate usernames (I know there is at least few, and as I know, one of those are different users, might be also other ones)?
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] PunBB to phpBB convertor

Post by D¡cky »

Hmmm, passwords could be a problem.

The PunBB to phpBB convertor does come with instructions on how to make the PunBB passwords work on phpBB, so that is not a problem. The problem comes during the merge. Users will be merged if the username is the same AND(password OR email) are the same. So, if a user registered on PunBB and phpBB with the same name and email, they will be merged. If a user registered on PunBB and phpBB with the same username and different emails, they will not be merged because the passwords will be different.

You may end up with duplicate usernames on the merged phpBB board. I believe the merge script provides a list of duplicate usernames so you can edit, or delete, the duplicates after the merge.
Have you hugged someone today?
op76
Registered User
Posts: 111
Joined: Thu Oct 10, 2002 11:01 pm
Location: Finland
Contact:

Re: [SUPPORT] PunBB to phpBB convertor

Post by op76 »

Lets hope so...and even better, if that list shows somehow, how active has each of them been, so decicion would be easier.

Thanks mate, you have been very helpful.
wobo
Registered User
Posts: 128
Joined: Tue May 04, 2004 4:28 am

Re: [SUPPORT] PunBB to phpBB convertor

Post by wobo »

Hi,
first I must say that I am very impressed about the punbb2phpbb converter, Very easy, even for a non-expert.
I am just in the middle to convert a punbb forum with 177k posts and ran into a problem:

The converter converted members, forums and categories as well as all 177,222 post titles. But in second stage it stops at

Code: Select all

Conversion of 179222 Post texts from post number 89300 ... OK
I reproduced the routine with the same result.

wobo
Parents: Talk to your kids about Linux!
Before someone else does it!
wobo
Registered User
Posts: 128
Joined: Tue May 04, 2004 4:28 am

Re: [SUPPORT] PunBB to phpBB convertor

Post by wobo »

Problem solved. It must have been the PHP or Apache timeout. I ran the script conv_posts_text.php on the CLI on the server and it worked great. After it ended with a seccess message I returned to the browser and completed the conversion the "normal" way.

Now I ran into the passwd problem. No passwords were converted.
EDIT: Solved with SelinaK's changes of the password field and the login.php, thx!

wobo
Parents: Talk to your kids about Linux!
Before someone else does it!
relooc
Registered User
Posts: 1
Joined: Sat Sep 27, 2008 10:43 am

Re: [SUPPORT] PunBB to phpBB convertor

Post by relooc »

The script is working, but convert only english posts in my base

The russian nicks, posts, groups etc all changed to ????????? ?????? charsters, what I do wrong? :cry:
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] PunBB to phpBB convertor

Post by D¡cky »

Did you move the database before or after the conversion? The convertor does not change the characters at all.
Have you hugged someone today?
d4v35p4
Registered User
Posts: 2
Joined: Wed Oct 29, 2008 7:30 pm

Re: [SUPPORT] PunBB to phpBB convertor

Post by d4v35p4 »

Hi,

I'm getting this error:
Couldn't obtain topic starter id.
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'O Roll'' at line 1

SELECT id, username FROM punbb_users WHERE `username` = 'Sushi 'O Roll'
Does anyone know a work-around for this? I tried manually removing all brackets but there are too many, and I'd like to have users keep their usernames, brackets included...
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] PunBB to phpBB convertor

Post by D¡cky »

OPEN conv_topics.php
FIND

Code: Select all

$sql_uid = "SELECT id, username FROM " . PUNBB_USERS_TABLE . " WHERE `username` = '" . $posts_data[$i]['poster'] . "'";
REPLACE WITH

Code: Select all

$sql_uid = "SELECT id, username FROM " . PUNBB_USERS_TABLE . " WHERE `username` = '" . addslashes($posts_data[$i]['poster']) . "'";
Have you hugged someone today?
d4v35p4
Registered User
Posts: 2
Joined: Wed Oct 29, 2008 7:30 pm

Re: [SUPPORT] PunBB to phpBB convertor

Post by d4v35p4 »

Thank you, that worked like a charm...

mille grazie
Locked

Return to “[2.0.x] Convertors”