• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 vb import users. Server error / Mysqli prepare error

snoopy5

Well-known member
#1
Hi

Importing a vb 3.8.0 forum into XF. In the step of importing users, I get the following error:

Server Error

Mysqli prepare error: 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 'ON (user.userid = userfield.userid) STRAIGHT_JOIN vb_xxxxx_usertextfield AS' at line 12
  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 734
  5. Zend_Db_Adapter_Abstract->fetchAll() in XenForo/Importer/vBulletin.php at line 777
  6. XenForo_Importer_vBulletin->stepUsers() in XenForo/Importer/Abstract.php at line 77
  7. XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 180
  8. XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 232
  9. XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 175
  10. XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 310
  11. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  12. XenForo_FrontController->run() in /xxxxxx/xxxxxx/_tests/xfdt_import/admin.php at line 13
Any idea what this can be/ how this can be fixed?
 

snoopy5

Well-known member
#2
I tried this with another xf fresh installation and another vb 3.8.0 forum. Exact same error during this step. MAybe there is something differet with vb 3.8.0 compared to other 3.8.x versions?

Both vb forums have a Mysql4 database by the way...
 

Adam Howard

Well-known member
#3
I tried this with another xf fresh installation and another vb 3.8.0 forum. Exact same error during this step. MAybe there is something differet with vb 3.8.0 compared to other 3.8.x versions?

Both vb forums have a Mysql4 database by the way...
XenForo System Requirements

PHP: 5.2.4+
MySQL: 5.0+
PHP extensions: MySQLi, GD (with JPEG support), PCRE, SPL, SimpleXML, DOM, JSON, iconv, ctype
PHP safe_mode off
 

snoopy5

Well-known member
#4
XenForo System Requirements

PHP: 5.2.4+
MySQL: 5.0+
PHP extensions: MySQLi, GD (with JPEG support), PCRE, SPL, SimpleXML, DOM, JSON, iconv, ctype
PHP safe_mode off

yes, this is the requirement for the XF installation. And both xf installations have mysql5. But the old vb installations have mysql4.

Is for the db which will be imported into the Xf also mysql5 required? That would be strange...
 

Adam Howard

Well-known member
#5
yes, this is the requirement for the XF installation. And both xf installations have mysql5. But the old vb installations have mysql4.

Is for the db which will be imported into the Xf also mysql5 required? That would be strange...
I misunderstood ....

I thought your copy of vBulletin was still running on a MySQL 4 server. If it was... You'd need to import it or upgrade it into a MySQL 5 server.

That would not be strange, that would be the accepted norm and standard. MySQL 4 was discontinued over 8 years ago and is very insecure (and unstable) compared to today's standards.
 

Jake Bunce

XenForo moderator
Staff member
#6
Zend_Db_Adapter_Abstract->fetchAll() in XenForo/Importer/vBulletin.php at line 777
This line number doesn't match up. Have you modified that file?

The syntax error appears to be from this SQL:

Code:
	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
			STRAIGHT_JOIN ' . $this->_prefix . 'userfield AS userfield ON (user.userid = userfield.userid)
			STRAIGHT_JOIN ' . $this->_prefix . 'usertextfield AS usertextfield ON (user.userid = usertextfield.userid)
			LEFT JOIN ' . $this->_prefix . 'administrator AS admin ON (user.userid = admin.userid)
			LEFT JOIN ' . $this->_prefix . 'userban AS userban ON (user.userid = userban.userid)
			LEFT JOIN ' . $this->_prefix . 'usergroup AS usergroup ON (user.usergroupid = usergroup.usergroupid)
			LEFT JOIN ' . $this->_prefix . 'customavatar AS customavatar ON (user.userid = customavatar.userid)
			WHERE ' . $where . '
			ORDER BY user.userid
		';
	}
There is no user input in play there except for the source table prefix. Otherwise it could be your MySQL version as Adam said.