vbulletin 4.x to phpbb 3.3

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Post Reply
jayne dwohnson
Registered User
Posts: 13
Joined: Tue Dec 29, 2020 3:36 pm

vbulletin 4.x to phpbb 3.3

Post by jayne dwohnson »

hey.
just had some hard days converting a well sized vbulletin 4.x forum to a fresh phpbb 3.3.3
maybe an uncommon case as the db indeed is huge, anyway, just in case someone else also struggling with saving an old forum... i've got trillions of errors i got through, in the end i've bet the deamons. heres some hints:

3.0.14 converter ragequitting with 500 internal server error
viewtopic.php?p=13252438#p13252438

used an custom function to split (does not break bbcode :)) posts with 60k long posts without any space/breaks/etc.

Code: Select all

SELECT postid, LENGTH(pagetext) FROM vb4_post ORDER BY LENGTH(pagetext) DESC;
functions_vb4.php

Code: Select all

//convert_x_custom

function vb_prepare_message2($message)
{
	global $convert, $user, $convert_row, $message_parser;

	if (!$message)
	{
		$convert->row['mp_bbcode_bitfield'] = $convert_row['mp_bbcode_bitfield'] = 0;
		return '';
	}

	$convert_input = str_split($message);
	$convert_output = "";
	$convert_sep = " ";
    
	$convert_thresh = 150;
    
	$convert_c = 0;
	foreach($convert_input as $convert_key => $convert_value) {
		$convert_c += 1;
		if (ctype_space($convert_value) || $convert_value == "]" || $convert_value == "[" || $convert_value == ":") {
			$convert_c = 0;
		}
		if ($convert_c >= $convert_thresh) {
			$convert_output .= $convert_sep . $convert_value;
			$convert_c = 0;
		}
		else {
			$convert_output .= $convert_value;
		}
	}
	$message = $convert_output;

	$message = preg_replace('#<(br|br/|br /|br\s/)>#i', "\n", $message);

	if (!empty($convert_row['allowsmilie']))
	{
		vb_reformat_smilies($message);
	}

	// Convert inline attachment bbcode
	if (!empty($convert_row['attach']))
	{
		vb_reformat_inline_attach($message, $convert_row['postid']);
	}

	$message = preg_replace('#\[glow=(.*?):(.*?)\]#i', "[glow=\\1]", $message);
	$message = preg_replace('#\[shadow=(.*?):(.*?)\]#i', "[shadow=\\1]", $message);
	$message = preg_replace('#\[\/glow:(.*?)\]#i', "[/glow]", $message);
	$message = preg_replace('#\[\/shadow:(.*?)\]#i', "[/shadow]", $message);
	$message = preg_replace( '/\[url=\"(.+?)\"]/si', "[url=\\1]", $message );
	$message = preg_replace( '/\[url=\'(.+?)\']/si', "[url=\\1]", $message );

	$bbcode_replacements = array(
		'[center]'	=> '[align=center]',
		'[/center]'	=> '[/align]',
		'<center>'	=> '[align=center]',
		'</center>' => '[/align]',
		'[left]'	=> '[align=left]',
		'[/left]'	=> '[/align]',
		'[right]'	=> '[align=right]',
		'[/right]'	=> '[/align]',
		'[li]'		=> '[*]',
		'[FONT='	=> '[font=',
		'[/FONT]'	=> '[/font]',
		'[COLOR='	=> '[color=',
		'[/COLOR]'	=> '[/color]',
		'[QUOTE'	=> '[quote',
		'[PHP]'		=> '[code=php]',
		'[/PHP]'	=> '[/##code]',
		'[/SIZE]'	=> '[/size]',
	);

	$message = str_replace(array_keys($bbcode_replacements), $bbcode_replacements, $message);

	//	From vb3 to phpBB2 convertor
	$search = "/\[size=([0-9]+)\]/ie";
	$replace = "'[size='.( (\\1 == 1) ? 9 : ( (\\1 == 2) ? 10 : 4*\\1 )) .']'";

	if (stripos($message, '[size=') !== false)
	{
		$message = preg_replace($search, $replace, $message);
		$message = preg_replace_callback('/\[size=(\d*)\]/i', 'vb_replace_size', $message);
	}

	if (strpos($message, '[quote=') !== false)
	{
		$message = preg_replace('/\[quote="(.*?)"\]/s', '[quote=&quot;\1&quot;]', $message);
		$message = preg_replace('/\[quote=(.*?);(.*?)\]/s', '[quote=\1]', $message);
		$message = preg_replace('/\[quote=(.*?)\]/s', '[quote=&quot;\1&quot;]', $message);
	}

	// Already the new user id ;)
	$user_id = $convert->row['poster_id'];

	$message = str_replace('<', '&lt;', $message);
	$message = str_replace('>', '&gt;', $message);

	// make the post UTF-8
	$message = vb_set_encoding($message);

	$message_parser->warn_msg = array(); // Reset the errors from the previous message
	$message_parser->bbcode_uid = make_uid($convert->row['post_time']);
	$message_parser->message = $message;
	unset($message);

	// Make sure options are set.
	$enable_bbcode = (!isset($convert->row['enable_bbcode'])) ? true : $convert->row['enable_bbcode'];
	$enable_smilies = (!isset($convert->row['allowsmilie'])) ? true : $convert->row['allowsmilie'];
	$enable_magic_url = (!isset($convert->row['enable_magic_url'])) ? true : $convert->row['enable_magic_url'];

	// parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post')
	$message_parser->parse($enable_bbcode, $enable_magic_url, $enable_smilies);

	if (sizeof($message_parser->warn_msg))
	{
		$msg_id = isset($convert->row['post_id']) ? $convert->row['post_id'] : $convert->row['privmsgs_id'];
		$convert->p_master->error('<span style="color:red">' . $user->lang['POST_ID'] . ': ' . $msg_id . ' ' . $user->lang['CONV_ERROR_MESSAGE_PARSER'] . ': <br /><br />' . implode('<br />', $message_parser->warn_msg), __LINE__, __FILE__, true);
	}

	$convert->row['mp_bbcode_bitfield'] = $convert_row['mp_bbcode_bitfield'] = $message_parser->bbcode_bitfield;

	$message = $message_parser->message;
	unset($message_parser->message);

	return $message;
}
remove the "##" needed due to bbcode

Code: Select all

		'[/PHP]'	=> '[/##code]',
convert_vb4.php

Code: Select all

array('post_text',				'post.pagetext',				'vb_prepare_message2'),
-> vb_prepare_message2

play around with $convert_thresh = 150;, 150 is what got me beyond all errors...
i've had to switch to nginx every this and then to get a clean convert btw, all "full converts" with apache only at some point quitted with 500s after serveral hours

vb4_poll
faked poll counts from vbulletin break phpbb's database. look out for too big values, separated with

Code: Select all

|||
shrink/clean the vbulletin database

Code: Select all

TRUNCATE vb4_ipdata; TRUNCATE vb4_searchcore_text; TRUNCATE vb4_searchcore; TRUNCATE vb4_contentread; TRUNCATE vb4_postparsed; TRUNCATE vb4_searchgroup; TRUNCATE vb4_searchgroup_text; TRUNCATE vb4_profilevisitor; TRUNCATE vb4_sigparsed; TRUNCATE vb4_ingame_like_history; TRUNCATE vb4_phrase; TRUNCATE vb4_adminlog; TRUNCATE vb4_pmreceipt; TRUNCATE vb4_userchangelog; TRUNCATE vb4_passwordhistory; TRUNCATE vb4_moderatorlog; TRUNCATE vb4_threadrate; TRUNCATE vb4_postedithistory; TRUNCATE vb4_editlog; TRUNCATE vb4_autosave; TRUNCATE vb4_activitystream; TRUNCATE vb4_activitystreamtype; TRUNCATE vb4_adminhelp; TRUNCATE vb4_administrator; TRUNCATE vb4_adminmessage; TRUNCATE vb4_adminutil; TRUNCATE vb4_album; TRUNCATE vb4_announcement; TRUNCATE vb4_announcementread; TRUNCATE vb4_deletionlog; TRUNCATE vb4_infraction; TRUNCATE vb4_infractionban; TRUNCATE vb4_infractiongroup; TRUNCATE vb4_infractionlevel; TRUNCATE vb4_imagecategory; TRUNCATE vb4_imagecategorypermission; TRUNCATE vb4_forumread; TRUNCATE vb4_groupmessage; TRUNCATE vb4_notice; TRUNCATE vb4_noticecriteria; TRUNCATE vb4_noticedismissed; TRUNCATE vb4_phrasetype; TRUNCATE vb4_picturecomment; TRUNCATE vb4_picturecomment_hash; TRUNCATE vb4_picturelegacy; TRUNCATE vb4_plugin; TRUNCATE vb4_postlog; TRUNCATE vb4_product; TRUNCATE vb4_productcode; TRUNCATE vb4_productdependency; TRUNCATE vb4_profileblockprivacy; TRUNCATE vb4_searchlog; TRUNCATE vb4_stats; TRUNCATE vb4_style; TRUNCATE vb4_stylevar; TRUNCATE vb4_stylevardfn; TRUNCATE vb4_upgradelog; TRUNCATE vb4_socialgroupmember; TRUNCATE vb4_tachythreadcounter; TRUNCATE vb4_faq; TRUNCATE vb4_datastore; TRUNCATE vb4_externalcache; TRUNCATE vb4_navigation; TRUNCATE vb4_cron; TRUNCATE vb4_templatehistory; TRUNCATE vb4_templatemerge; TRUNCATE vb4_reputationlevel; TRUNCATE vb4_template; TRUNCATE vb4_subscribeforum; TRUNCATE vb4_threadread; TRUNCATE vb4_cronlog; TRUNCATE vb4_session;
MatthijsWink
Registered User
Posts: 4
Joined: Fri May 21, 2021 8:24 am

Re: vbulletin 4.x to phpbb 3.3

Post by MatthijsWink »

Hi, I also want to convert our vBulelting 4.4.2 to phpBB 3
Where can I find the converter you used?
thanks for any help!
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26520
Joined: Fri Aug 29, 2008 9:49 am

Re: vbulletin 4.x to phpbb 3.3

Post by Mick »

There’s a link at the beginning of the op’s post but it was presumably from this list of convertors presently available here.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
MatthijsWink
Registered User
Posts: 4
Joined: Fri May 21, 2021 8:24 am

Re: vbulletin 4.x to phpbb 3.3

Post by MatthijsWink »

Hi Mick, thanks for your reply.
I found vb4_convertor_1.1.1.zip, but in the post it is mentioned; This has been tested with vBulletin 4.2.0 and phpBB 3.0.11
Did you use this version to upgrade to 3.3.x?
User avatar
Prosk8er
Registered User
Posts: 1744
Joined: Sun Mar 12, 2006 3:30 am
Location: Rochester, NY
Name: Tyler
Contact:

Re: vbulletin 4.x to phpbb 3.3

Post by Prosk8er »

you need to convert it to phpbb 3.0.11 first then from there you convert to phpbb 3.3.x
Post Reply

Return to “[3.3.x] Convertors”