• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

vBulletin 4 Importer

I haven't run this, but based on the error message, I would suggest that the problem is that Paul's vBulletin 4 importer is trying to join multiple tables with 'USING', which tends only to work in limited circumstances. Generally, when joining multiple tables, one should join those tables with 'ON'.

Try editing the vBulletin4.php script to replace this:
PHP:
protected function _getSelectUserSql($where)
{
	return '
		SELECT user.*, userfield.*, usertextfield.*,
			IF(admin.userid IS NULL, 0, 1) AS is_admin,
			admin.adminpermissions AS admin_permissions,
			IF(userban.userid IS NULL, 0, 1) AS is_banned,
			userban.bandate AS ban_date,
			userban.liftdate AS ban_end_date,
			userban.reason AS ban_reason,
			userban.adminid AS ban_user_id,
			IF(usergroup.adminpermissions & 1, 1, 0) AS is_super_moderator,
			IF(customavatar.userid, 1, 0) AS has_custom_avatar
		FROM ' . $this->_prefix . 'user AS user
		LEFT JOIN ' . $this->_prefix . 'userfield AS userfield USING (userid)
		LEFT JOIN ' . $this->_prefix . 'usertextfield AS usertextfield USING (userid)
		LEFT JOIN ' . $this->_prefix . 'administrator AS admin USING (userid)
		LEFT JOIN ' . $this->_prefix . 'userban AS userban USING (userid)
		LEFT JOIN ' . $this->_prefix . 'usergroup AS usergroup ON (user.usergroupid = usergroup.usergroupid)
		LEFT JOIN ' . $this->_prefix . 'customavatar AS customavatar USING (userid)
		WHERE ' . $where . '
		ORDER BY user.userid
	';
}
With this:
PHP:
protected function _getSelectUserSql($where)
{
	return '
		SELECT user.*, userfield.*, usertextfield.*,
			IF(admin.userid IS NULL, 0, 1) AS is_admin,
			admin.adminpermissions AS admin_permissions,
			IF(userban.userid IS NULL, 0, 1) AS is_banned,
			userban.bandate AS ban_date,
			userban.liftdate AS ban_end_date,
			userban.reason AS ban_reason,
			userban.adminid AS ban_user_id,
			IF(usergroup.adminpermissions & 1, 1, 0) AS is_super_moderator,
			IF(customavatar.userid, 1, 0) AS has_custom_avatar
		FROM ' . $this->_prefix . 'user AS user
		LEFT JOIN ' . $this->_prefix . 'userfield AS userfield ON (userfield.userid = user.userid)
		LEFT JOIN ' . $this->_prefix . 'usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
		LEFT JOIN ' . $this->_prefix . 'administrator AS admin ON (admin.userid = user.userid)
		LEFT JOIN ' . $this->_prefix . 'userban AS userban ON (userban.userid = user.userid)
		LEFT JOIN ' . $this->_prefix . 'usergroup AS usergroup ON (user.usergroupid = usergroup.usergroupid)
		LEFT JOIN ' . $this->_prefix . 'customavatar AS customavatar ON (customavatar.userid = user.userid)
		WHERE ' . $where . '
		ORDER BY user.userid
	';
}
Shout back if this does not resolve the problem. :)
 
Same here, the whole transfer process is stalled waiting for this bug to be fixed.
AFAIK, its not a bug.

Mysql4 differs in how USING works. One of the requirements for XF is mysql5, and the code should be fine in that case. Its never failed for me, but I will test it again.

You can edit it yourself as detailed by Kier above, but I wont change the importer to cope with a version of mysql that is below the XF requirements. :)
 
I haven't run this, but based on the error message, I would suggest that the problem is that Paul's vBulletin 4 importer is trying to join multiple tables with 'USING', which tends only to work in limited circumstances. Generally, when joining multiple tables, one should join those tables with 'ON'.

Try editing the vBulletin4.php script to replace this:
PHP:
protected function _getSelectUserSql($where)
{
return '
SELECT user.*, userfield.*, usertextfield.*,
IF(admin.userid IS NULL, 0, 1) AS is_admin,
admin.adminpermissions AS admin_permissions,
IF(userban.userid IS NULL, 0, 1) AS is_banned,
userban.bandate AS ban_date,
userban.liftdate AS ban_end_date,
userban.reason AS ban_reason,
userban.adminid AS ban_user_id,
IF(usergroup.adminpermissions & 1, 1, 0) AS is_super_moderator,
IF(customavatar.userid, 1, 0) AS has_custom_avatar
FROM ' . $this->_prefix . 'user AS user
LEFT JOIN ' . $this->_prefix . 'userfield AS userfield USING (userid)
LEFT JOIN ' . $this->_prefix . 'usertextfield AS usertextfield USING (userid)
LEFT JOIN ' . $this->_prefix . 'administrator AS admin USING (userid)
LEFT JOIN ' . $this->_prefix . 'userban AS userban USING (userid)
LEFT JOIN ' . $this->_prefix . 'usergroup AS usergroup ON (user.usergroupid = usergroup.usergroupid)
LEFT JOIN ' . $this->_prefix . 'customavatar AS customavatar USING (userid)
WHERE ' . $where . '
ORDER BY user.userid
';
}
With this:
PHP:
protected function _getSelectUserSql($where)
{
return '
SELECT user.*, userfield.*, usertextfield.*,
IF(admin.userid IS NULL, 0, 1) AS is_admin,
admin.adminpermissions AS admin_permissions,
IF(userban.userid IS NULL, 0, 1) AS is_banned,
userban.bandate AS ban_date,
userban.liftdate AS ban_end_date,
userban.reason AS ban_reason,
userban.adminid AS ban_user_id,
IF(usergroup.adminpermissions & 1, 1, 0) AS is_super_moderator,
IF(customavatar.userid, 1, 0) AS has_custom_avatar
FROM ' . $this->_prefix . 'user AS user
LEFT JOIN ' . $this->_prefix . 'userfield AS userfield ON (userfield.userid = user.userid)
LEFT JOIN ' . $this->_prefix . 'usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
LEFT JOIN ' . $this->_prefix . 'administrator AS admin ON (admin.userid = user.userid)
LEFT JOIN ' . $this->_prefix . 'userban AS userban ON (userban.userid = user.userid)
LEFT JOIN ' . $this->_prefix . 'usergroup AS usergroup ON (user.usergroupid = usergroup.usergroupid)
LEFT JOIN ' . $this->_prefix . 'customavatar AS customavatar ON (customavatar.userid = user.userid)
WHERE ' . $where . '
ORDER BY user.userid
';
}
Shout back if this does not resolve the problem. :)

Worked like a charm, thanks
 
Seems that maybe 95% of my users were imported but the most recent users were forgotten :(. Any idea why? This script executed without any errors shown. Any easy way to finish importing the rest?
 
That would make sense... but I can confirm that somehow some users don't exist in the new system and they existed (and were active) in the old system. These were relatively new users, but nevertheless should've been imported.
 
Without access to your database I cannot really comment, but unless there is something wrong with their set-up in vb, they should be imported.
 
Paul, with the recent announcement, are you planning on keeping this up to date, or will it become unsupported? Not trying to open any can of worms, just asking the question and that's it. =)
 
I updated the first post last week. :)

TBH, it doesnt really need much support, its hardly changed in the last few months, and no real issues.
 
That would make sense... but I can confirm that somehow some users don't exist in the new system and they existed (and were active) in the old system. These were relatively new users, but nevertheless should've been imported.
Did you at any point allow for users to have multiple accounts (on the same email address)? If so, that might be the reason some are missing now.
 
Sorry if this has been asked before but I want to convert a fairly large vBulletin board with 500,000 posts.

I dont want to lose my URL structure for search engine reasons. Will the importer import the URL's the same as vBulletin or will they change?
 
At a old forum the part of quotes contains in a kind
Code:
[QUOTE=Nickname;1]
but a part in a kind
Code:
[QUOTE="Nickname;1"]
Therefore for correct search of all quotes it was required to change regular expression (add "?) as follows:
PHP:
// Remap Quotes (Krochinzky)
if (preg_match_all('/\[QUOTE=.+;(\d+)"?\]/i', $post['pagetext'], $matches))
{
    $postIdMap = $model->getImportContentMap('post', $matches[1]);
    foreach($matches[1] as $key => $oldPostId)
    {
        $newPostId = $this->_mapLookUp($postIdMap, $oldPostId);
        $post['pagetext'] =  preg_replace('/\[QUOTE="?(.+);(' . $oldPostId . ')"?\]/i', '[QUOTE="$1, post: ' . $newPostId . '"]', $post['pagetext']);
    }
}
Please, make changes in following addition release.
 
Top Bottom