[BETA] IPB 1.3 to phpBB3 Convertor

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Scam Warning
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: [BETA] IPB 1.3 to phpBB3 Convertor

Post by D¡cky »

swifter_uk,

You are correct. The convertor does not affect your currently running IPB board. You can do the conversion as many times as you like.
Have you hugged someone today?
swifter_uk
Registered User
Posts: 26
Joined: Fri Jul 10, 2009 8:32 pm

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by swifter_uk »

Very good.

Thank You ;)
maat
Registered User
Posts: 39
Joined: Wed Feb 27, 2008 7:49 am

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by maat »

swifter_uk wrote:Thanks for the replies so far.
One more question, is it possible to run the convertor to test it, am I correct to assume it does not affect the running of the existing software I am converting. I'd like to see how much work I have to do when I am ready for the final changeover, it will give me some idea of how much time to allow for the current board to be shut down.
yes the convertor does not affect ipb forum : it just reads data from it. hence you can run it several times without side effects.
User avatar
RavenMokel
Registered User
Posts: 9
Joined: Fri May 15, 2009 7:49 pm
Contact:

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by RavenMokel »

So, finally i tried the conversion again with a simpler apache/vhost/directory-setup and it worked. So, yes, the setup probably was to blame. Sorry.

So far, a lot of things look nice (forums, posts, avatars, attachments...), but something is strange with some of the converted users: I can find (and edit etc.) some of my users using the ACP, but they don't show up in the normal member list of the board.

Some also didn't get assigned the right groups. Some just "lost" their group (and are only members of "Registered users" now, even though they had a group in the old IPB). Some were even assigned to wrong groups.

Some also seem to have the "hide my online status" preference set, even though they didn't have that set in the source IPB (although i'm not 100% sure on that one, since i haven't found out where IPB stores that setting in the db and all users can't access their control centers in the old IPB, which is one of the reasons for the whole conversion...). This seems to affect a lot (all?) of the users that also have the other problems mentioned. So it could be connected...

Strangely, it does not seem to affect all users, just a subset. So far, i haven't found out what distinguishes them... If there's anything i could do (i could e.g. provide some db dumps) to help with debugging this, i would be glad to do it. I have set up a copy of the old board and the new board on a separate testing server now, so i can try out anything.

-David
maat
Registered User
Posts: 39
Joined: Wed Feb 27, 2008 7:49 am

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by maat »

well seems rather odd an issue :)

if you could provide with a db dump that would help obviously :)

btw are you using a standard ipb13 or a patched one ?
User avatar
RavenMokel
Registered User
Posts: 9
Joined: Fri May 15, 2009 7:49 pm
Contact:

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by RavenMokel »

Yes, it does seem rather odd... The sooner i can throw away the old IPB board that is causing all this oddity (not only the conversion, it has a lot of other problems), the better...

I have kind of "inherited" this board, so i'm not completely sure what has been modified in it. I am sure of at least two mods, one for having a user picture separate from the avatar and one for having custom fields in the profile. But i don't really care that both are probably lost in the conversion process, having the basic user/group/board setup converted completely is all that i am hoping for. And we are using a german localization, but that shouldn't change anything in the db. Apart from that, it's probably a pretty standard IPB "v1.3.1 Final".

I'll send you a PM with details on the DB dump.

Thanks for all the effort, again! :)

-David
User avatar
JReese
Registered User
Posts: 2
Joined: Wed Oct 28, 2009 4:50 pm
Location: Pennsylvania
Contact:

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by JReese »

Well I spent tonight giving this converter a go and through a little hoop jumping to get my DB migrated from 4.0 to 5.0 I seem to have the "pre-conversion" issues out of the way but now after I finally get to the third stage of "conversion in progress" but just a few seconds after clicking the "continue conversion" button I am quickly stopped by the following error.

Code: Select all

[phpBB Debug] PHP Notice: in file /install/convertors/functions_ipb13.php on line 1234: filesize() [function.filesize]: Stat failed for ./../../forum/uploads/post-7-1119757780.ibf (errno=2 - No such file or directory)
Can anyone shed any insight on how to bypass this? If I check my /uploads/ directory through FTP there is no "post-7-1119757780.ibf" file like it errors on so I see why it is stopping it but if its just an attachment I don't really care if it isn't converted.
swifter_uk
Registered User
Posts: 26
Joined: Fri Jul 10, 2009 8:32 pm

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by swifter_uk »

Well I finally got round to setting up a new phpBB3 board and running a test conversion of our old ipb1.3 forums, all seems to have gone fairly smoothly on the conversion apart from one issue I have noticed so far.

When I view the board index page, last post's in all forums are stuck at 2005? However going into each forum the correct up to date topics are there. You can view what I mean here http://retiredgreyhounds.info/phpBB/index.php

I also was required to request a new password, is that normal and will it be the same for all of our members?
clomax
Registered User
Posts: 1
Joined: Wed Feb 10, 2010 1:31 pm

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by clomax »

hi maat,
today i've used your converter to convert my board from IPB 1.3.1 to phpBB3 and it worked very well.
actualy it seems that the only missed things are the quote message.
i've seen your code and i've found that it doesn't work if the format date contains one or more character "-" (minus).

my message:
$message = "<!--QuoteBegin-Clomax+10-02-2010, 13:30--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Clomax &#064; 10-02-2010, 13:30)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> sasa <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd--><br> non va ";

your code:
$message = preg_replace("/<!--QuoteBegin-[^-]+--><\/div><table [^>]*><tr><td><b>QUOTE<\/b> \(([^\)]+)\)<\/td><\/tr><tr><td id='QUOTE'><!--QuoteEBegin-->/siU","[quote=\"\\1\"]\r\n",$message);

my code:
$message = preg_replace("/<!--QuoteBegin-.+--><\/div><table [^>]*><tr><td><b>QUOTE<\/b> \(([^\)]+)\)<\/td><\/tr><tr><td id='QUOTE'><!--QuoteEBegin-->/siU","[quote=\"\\1\"]\r\n",$message);

the problem:
<!--QuoteBegin-Clomax+10-02-2010, 13:30-->
<!--QuoteBegin-admin+Jul 7 2008, 04:19 PM-->

the question is: why you have decided to filter the minus character?
OllieJack
Registered User
Posts: 1
Joined: Fri Jul 02, 2010 2:54 am

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by OllieJack »

Hi All!
I'm a bit late to the party for converting IPB 1.3 to phpBB 3.x and after many attempts at failing (realised I was using IPB 2.x convertor thinking that's what the old board was) I got the correct convertor and it started converting, but quickly came up with first error as follows.

Code: Select all

[phpBB Debug] PHP Notice: in file /install/convertors/functions_ipb13.php  on line 1234: filesize() [function.filesize]: stat failed for ./../../testforum/uploads/post-8-1076568855.jpg
It lists this code several times - 14 times actually all with different post-8-xxxxxxxxxx.jpg

Line 1234 of the functions_ipb13.php is

Code: Select all

	return filesize($convert->options['forum_path'] . '/uploads/' . $attachement_filename);
Can some one help solve this problem?
I noticed JReese above had a similar problem and no answer came.

Please note I am a little bit of a novice at all this, but I can change codes in php files using PSPad!

Thanks!
Ollie
smikthb
Registered User
Posts: 2
Joined: Mon May 23, 2011 8:56 pm

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by smikthb »

okay for some odd reason i can not get the convorter to work! I can not figure out the board path?? I know the path to my board and for some reason it keeps giving me an error saying it is incorrect. i tried it a million ways. what am i doing wrong?
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: [BETA] IPB 1.3 to phpBB3 Convertor

Post by D¡cky »

smikthb wrote:okay for some odd reason i can not get the convorter to work! I can not figure out the board path?? I know the path to my board and for some reason it keeps giving me an error saying it is incorrect. i tried it a million ways. what am i doing wrong?
What is the address to your phpBB board and what is the address to your IPB files?
Have you hugged someone today?
smikthb
Registered User
Posts: 2
Joined: Mon May 23, 2011 8:56 pm

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by smikthb »

They are in the same directory. I think im going to start fresh with a new install of phpbb.. i cant take these errors and what not it justs easier
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: [BETA] IPB 1.3 to phpBB3 Convertor

Post by D¡cky »

IPB and phpBB have to be in different directories. You should never install a program into a directory where another program exists. Files of the original program are likely to get overwritten by the new program so that now the original program no longer works.
Have you hugged someone today?
djGrrr
Registered User
Posts: 1
Joined: Fri Jun 24, 2011 4:33 pm

Re: [BETA] IPB 1.3 to phpBB3 Convertor

Post by djGrrr »

For those looking for a proper authentication file for IPB 1.3, i have written one that puts the passwords through the crazy clean_value function of IPB so that passwords with special characters in them still work correctly.

save this file as includes/auth/auth_ipb13.php

Code: Select all

<?php
/**
* Database + IPB 1.3 auth plug-in for phpBB3
*
* Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
*
* This is for authentication via the integrated user table
*
* @package login
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* IPB 1.3 clean_value function
*/
function ipb13_clean_value($val) {
	$strip_space_chr = true;
	$allow_unicode = true;


	if ($val == '')
		return '';

	$val = str_replace('&#032;', ' ', $val);
	if ($strip_space_chr)
		$val = str_replace("\xC3\x8A", '', $val); //Remove sneaky spaces

	$val = str_replace('&'				, '&'			, $val);
	$val = str_replace('<!--'			, '<&#33;--'	, $val);
	$val = str_replace('-->'			, '-->'			, $val);
	$val = preg_replace('/<script/i'	, '<script'		, $val);
	$val = str_replace('>'				, '>'			, $val);
	$val = str_replace('<'				, '<'			, $val);
	$val = str_replace('"'				, '"'			, $val);
	$val = preg_replace("/\n/"			, '<br>'			, $val); // Convert literal newlines
	$val = preg_replace("/\\\$/"		, '&#036;'			, $val);
	$val = preg_replace("/\r/"			, ''				, $val); // Remove literal carriage returns
	$val = str_replace('!'				, '&#33;'			, $val);
	$val = str_replace("'"				, '''			, $val); // IMPORTANT: It helps to increase sql query safety.

	// Ensure unicode chars are OK
	if ($allow_unicode)
		$val = preg_replace('/&#([0-9]+);/s', '&#\\1;', $val);

	// Swop user inputted backslashes
	$val = preg_replace("/\\\(?!&#|\?#)/", '&#092;', $val);

	return $val;
}

/**
* Login function
*/
function login_ipb13(&$username, &$password)
{
	global $db, $config;

	// do not allow empty password
	if (!$password)
	{
		return array(
			'status'	=> LOGIN_ERROR_PASSWORD,
			'error_msg'	=> 'NO_PASSWORD_SUPPLIED',
			'user_row'	=> array('user_id' => ANONYMOUS),
		);
	}

	if (!$username)
	{
		return array(
			'status'	=> LOGIN_ERROR_USERNAME,
			'error_msg'	=> 'LOGIN_ERROR_USERNAME',
			'user_row'	=> array('user_id' => ANONYMOUS),
		);
	}

	$sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
		FROM ' . USERS_TABLE . "
		WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
	$result = $db->sql_query($sql);
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if (!$row)
	{
		return array(
			'status'	=> LOGIN_ERROR_USERNAME,
			'error_msg'	=> 'LOGIN_ERROR_USERNAME',
			'user_row'	=> array('user_id' => ANONYMOUS),
		);
	}
	$show_captcha = $config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'];

	// If there are too much login attempts, we need to check for an confirm image
	// Every auth module is able to define what to do by itself...
	if ($show_captcha)
	{
		// Visual Confirmation handling
		if (!class_exists('phpbb_captcha_factory'))
		{
			global $phpbb_root_path, $phpEx;
			include ($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
		}

		$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
		$captcha->init(CONFIRM_LOGIN);
		$vc_response = $captcha->validate($row);
		if ($vc_response)
		{
			return array(
				'status'		=> LOGIN_ERROR_ATTEMPTS,
				'error_msg'		=> 'LOGIN_ERROR_ATTEMPTS',
				'user_row'		=> $row,
			);
		}
		else
		{
			$captcha->reset();
		}
		
	}

	// If the password convert flag is set we need to convert it
	if ($row['user_pass_convert'])
	{
		// in phpBB2 passwords were used exactly as they were sent, with addslashes applied
		$password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
		$password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format;
		$password_new_format = '';

		set_var($password_new_format, stripslashes($password_old_format), 'string');

		if ($password == $password_new_format)
		{
			if (!function_exists('utf8_to_cp1252'))
			{
				global $phpbb_root_path, $phpEx;
				include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx);
			}

			// cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding
			// plain md5 support left in for conversions from other systems.
			// also checking against IPB's 1.3 crazy clean_value function
			if ((strlen($row['user_password']) == 34 && (phpbb_check_hash(md5($password_old_format), $row['user_password']) || phpbb_check_hash(md5(utf8_to_cp1252($password_old_format)), $row['user_password'])))
				|| (strlen($row['user_password']) == 32  && (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password'] || md5(ipb13_clean_value($password_old_format)) == $row['user_password'])))
			{
				$hash = phpbb_hash($password_new_format);

				// Update the password in the users table to the new format and remove user_pass_convert flag
				$sql = 'UPDATE ' . USERS_TABLE . '
					SET user_password = \'' . $db->sql_escape($hash) . '\',
						user_pass_convert = 0
					WHERE user_id = ' . $row['user_id'];
				$db->sql_query($sql);

				$row['user_pass_convert'] = 0;
				$row['user_password'] = $hash;
			}
			else
			{
				// Although we weren't able to convert this password we have to
				// increase login attempt count to make sure this cannot be exploited
				$sql = 'UPDATE ' . USERS_TABLE . '
					SET user_login_attempts = user_login_attempts + 1
					WHERE user_id = ' . (int) $row['user_id'] . '
						AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
				$db->sql_query($sql);

				return array(
					'status'		=> LOGIN_ERROR_PASSWORD_CONVERT,
					'error_msg'		=> 'LOGIN_ERROR_PASSWORD_CONVERT',
					'user_row'		=> $row,
				);
			}
		}
	}

	// Check password ...
	if (!$row['user_pass_convert'] && phpbb_check_hash($password, $row['user_password']))
	{
		// Check for old password hash...
		if (strlen($row['user_password']) == 32)
		{
			$hash = phpbb_hash($password);

			// Update the password in the users table to the new format
			$sql = 'UPDATE ' . USERS_TABLE . "
				SET user_password = '" . $db->sql_escape($hash) . "',
					user_pass_convert = 0
				WHERE user_id = {$row['user_id']}";
			$db->sql_query($sql);

			$row['user_password'] = $hash;
		}

		if ($row['user_login_attempts'] != 0)
		{
			// Successful, reset login attempts (the user passed all stages)
			$sql = 'UPDATE ' . USERS_TABLE . '
				SET user_login_attempts = 0
				WHERE user_id = ' . $row['user_id'];
			$db->sql_query($sql);
		}

		// User inactive...
		if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE)
		{
			return array(
				'status'		=> LOGIN_ERROR_ACTIVE,
				'error_msg'		=> 'ACTIVE_ERROR',
				'user_row'		=> $row,
			);
		}

		// Successful login... set user_login_attempts to zero...
		return array(
			'status'		=> LOGIN_SUCCESS,
			'error_msg'		=> false,
			'user_row'		=> $row,
		);
	}

	// Password incorrect - increase login attempts
	$sql = 'UPDATE ' . USERS_TABLE . '
		SET user_login_attempts = user_login_attempts + 1
		WHERE user_id = ' . (int) $row['user_id'] . '
			AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
	$db->sql_query($sql);

	// Give status about wrong password...
	return array(
		'status'		=> ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,
		'error_msg'		=> ($show_captcha) ? 'LOGIN_ERROR_ATTEMPTS' : 'LOGIN_ERROR_PASSWORD',
		'user_row'		=> $row,
	);
}

?>
Locked

Return to “[3.0.x] Convertors”