Server issue vbulletin 5 import error

Affected version
2.0.2

AWS

Well-known member
I get this when trying to import from vbulletin 5. This is using a clean install of 2.0.2. I did a test import with 2.0.1 and it worked without a problem. PHP version 7.2.1. I also backed PHP down to 5.6.30 and still get the same error.

Code:
ErrorException: [E_WARNING] mysqli::query(): invalid object or resource mysqli in src\XF\Db\Mysqli\Adapter.php at line 167

    XF::handlePhpError()
    mysqli->query() in src\XF\Db\Mysqli\Adapter.php at line 167
    XF\Db\Mysqli\Adapter->makeConnection() in src\XF\Db\Mysqli\Adapter.php at line 28
    XF\Db\Mysqli\Adapter->getConnection() in src\XF\Db\AbstractAdapter.php at line 51
    XF\Db\AbstractAdapter->connect() in src\XF\Db\AbstractAdapter.php at line 73
    XF\Db\AbstractAdapter->query() in src\XF\Db\AbstractAdapter.php at line 106
    XF\Db\AbstractAdapter->fetchAllKeyed() in src\XF\Import\Importer\vBulletin.php at line 569
    XF\Import\Importer\vBulletin->stepUserGroups() in src\XF\Import\Runner.php at line 160
    XF\Import\Runner->runStep() in src\XF\Import\Runner.php at line 74
    XF\Import\Runner->run() in src\XF\Admin\Controller\Import.php at line 232
    XF\Admin\Controller\Import->actionRun() in src\XF\Mvc\Dispatcher.php at line 249
    XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 88
    XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 41
    XF\Mvc\Dispatcher->run() in src\XF\App.php at line 1889
    XF\App->run() in src\XF.php at line 32
I want to do the final import to move the community and this is stopping me.

Thanks
 

AWS

Well-known member
It seems this error happens when you have any existing data. I had created another super admin user for post import. That has to what caused the error. I did a fresh install again and then the import worked.

On the import that gave the error there was an option to retain ID's. I didn't select it since I wanted to keep the extra user and knew from past experience selecting it would cause the import to not work.
 

Chris D

XenForo developer
Staff member
This is not something I'm able to reproduce in any of the scenarios you described. Certainly existing data wouldn't cause this, especially if retain IDs isn't set. From what I've seen via Google searches, this is usually caused by connection issues. Often the advice is to check you've entered the database details correctly but of course we have code which handles that and displays an appropriate error so I'm not sure why it wasn't being hit.

I suppose it's possible there were temporary issues with the MySQL connection and it was dropping between making the connection and trying to execute a query, though that certainly seems unlikely...

For now though, while it's working as expected, and the issue otherwise can't be reproduced, we'll have to chalk it up to one of those things, but please do let us know if it happens again.
 

AWS

Well-known member
I am doing the final import next week so if it happens again I'll post back.

I had something similiar happen before and it was a caching issue. I had to turn off Wincache to do an import. This might be the same issue.
 

AWS

Well-known member
This happened due to my server configuration. I use named pipes to connect to the mysql server so I remove this from config.php.
Code:
$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
Once I added it back to config.php the import worked as expected.
 
Top