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

XF 1.5 phpBB3 import error: Mysqli statement execute error : Duplicate entry '2' for key 'PRIMARY'

#1
Hello,

I am getting this error while I'm importing the threads/topics. I was able to import everything else so far without any problems.

Full error:

Code:
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 1627
XenForo_Model_Import->importThread() in XenForo/Importer/PhpBb3.php at line 1799
XenForo_Importer_PhpBb3->stepThreads() in XenForo/Importer/Abstract.php at line 124
XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 189
XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 241
XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 184
XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 351
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /home/gramous8/public_html/gramous/boards/admin.php at line 13
 
#2
Full error in the error log:

Code:
#0 /home/gramous8/public_html/gramous/boards/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/gramous8/public_html/gramous/boards/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/gramous8/public_html/gramous/boards/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /home/gramous8/public_html/gramous/boards/library/XenForo/DataWriter.php(1638): Zend_Db_Adapter_Abstract->insert('xf_thread', Array)
#4 /home/gramous8/public_html/gramous/boards/library/XenForo/DataWriter.php(1627): XenForo_DataWriter->_insert()
#5 /home/gramous8/public_html/gramous/boards/library/XenForo/DataWriter.php(1419): XenForo_DataWriter->_save()
#6 /home/gramous8/public_html/gramous/boards/library/XenForo/Model/Import.php(617): XenForo_DataWriter->save()
#7 /home/gramous8/public_html/gramous/boards/library/XenForo/Model/Import.php(1627): XenForo_Model_Import->_importData(2, 'XenForo_DataWri...', 'thread', 'thread_id', Array)
#8 /home/gramous8/public_html/gramous/boards/library/XenForo/Importer/PhpBb3.php(1799): XenForo_Model_Import->importThread(2, Array)
#9 /home/gramous8/public_html/gramous/boards/library/XenForo/Importer/Abstract.php(124): XenForo_Importer_PhpBb3->stepThreads(0, Array)
#10 /home/gramous8/public_html/gramous/boards/library/XenForo/ControllerAdmin/Import.php(189): XenForo_Importer_Abstract->runStep(Object(XenForo_ControllerAdmin_Import), Object(XenForo_ImportSession), 'threads', 0, Array)
#11 /home/gramous8/public_html/gramous/boards/library/XenForo/ControllerAdmin/Import.php(241): XenForo_ControllerAdmin_Import->_runStep(Object(XenForo_Importer_PhpBb31x), Object(XenForo_ImportSession), 'threads', 0, Array)
#12 /home/gramous8/public_html/gramous/boards/library/XenForo/ControllerAdmin/Import.php(184): XenForo_ControllerAdmin_Import->_startStep(Object(XenForo_Importer_PhpBb31x), Object(XenForo_ImportSession), 'threads', Array)
#13 /home/gramous8/public_html/gramous/boards/library/XenForo/FrontController.php(351): XenForo_ControllerAdmin_Import->actionStartStep()
#14 /home/gramous8/public_html/gramous/boards/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#15 /home/gramous8/public_html/gramous/boards/admin.php(13): XenForo_FrontController->run()
#16 {main}


Request State
array(3) {
  ["url"] => string(73) "http://37.60.252.123/~gramous8/gramous/boards/admin.php?import/start-step"
  ["_GET"] => array(1) {
    ["import/start-step"] => string(0) ""
  }
  ["_POST"] => array(2) {
    ["step_threads"] => string(24) "Import Threads and Posts"
    ["_xfToken"] => string(8) "********"
  }
}
 

Brogan

XenForo moderator
Staff member
#5
You can't retain IDs when importing into a forum with existing content, as IDs must be unique.

If you uncheck the option to retain IDs, the import will be able to proceed.