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

XF 1.5 Duplicate primary key error when importing vB 3.8x in a new XF 1.54


Active member

I have tried to import a 500.000 postings vBulletin 3.8 forum to a new XenForo 1.54 installation. Everything works fine until around 80% of importing forums and post, the the following mysql server error was displayed, see below.

Any ideas? Thank you in advance!

Kind regards,

Server Error

Mysqli statement execute error : Duplicate entry '442946' for key 'PRIMARY'
Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1638
XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1627
XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1419
XenForo_DataWriter->save() in XenForo/Model/Import.php at line 617
XenForo_Model_Import->_importData() in XenForo/Model/Import.php at line 1750
XenForo_Model_Import->importPost() in XenForo/Importer/vBulletin.php at line 2651
XenForo_Importer_vBulletin->stepThreads() in XenForo/Importer/Abstract.php at line 97
XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 189
XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 137
XenForo_ControllerAdmin_Import->actionImport() in XenForo/FrontController.php at line 351
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /home/www/domains/test.taschenlampen-forum.de/admin.php at line 13

array(3) {
["url"] => string(58) "http://test.taschenlampen-forum.de/admin.php?import/import"
["_GET"] => array(1) {
["import/import"] => string(0) ""
["_POST"] => array(1) {
["_xfToken"] => string(8) "********"


Jake Bunce

XenForo moderator
Staff member
1) Make sure your vB database doesn't have two posts with postid 442946. This is normally not possible but check it anyways.

2) Make sure your XF forum is a brand new installation and that no one is making posts during the import.

Those are the two likely explanations for this error. Once you have addressed both of these things then you will need to reinstall XenForo fresh and run the import again.

When you start an import it gives you an option to preserve the source ids. Enabling that option requires a brand new installation or you can get collisions like this.