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

Importing problem

#1
I recently got my SMF database converted to IPB 3.3 by my friend and now I am trying to convert it to Xenforo.
I am getting an error when I import user groups

" Server Error

Mysqli statement execute error : Duplicate entry '5' for key 'PRIMARY'
  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  4. Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1591
  5. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1580
  6. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1381
  7. XenForo_DataWriter->save() in XenForo/Model/Import.php at line 580
  8. XenForo_Model_Import->_importData() in XenForo/Model/Import.php at line 618
  9. XenForo_Model_Import->importUserGroup() in XenForo/Importer/IPBoard.php at line 346
  10. XenForo_Importer_IPBoard->stepUserGroups() in XenForo/Importer/Abstract.php at line 77
  11. XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 180
  12. XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 232
  13. XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 175
  14. XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 310
  15. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  16. XenForo_FrontController->run() in /home/creamy/public_html/admin.php at line 13 "

How can I solve it?

 

CyclingTribe

Well-known member
#2
Duplicate entry '5' for key 'PRIMARY'
If you have phpMyAdmin have a look at the field that the PRIMARY key is built on.

Whatever it is (usergroup ID maybe?) there appear to be two or more with the same value ...'5' ... and the import appears to be wanting unique values.

Cheers,
Shaun :D
 

Jake Bunce

XenForo moderator
Staff member
#3
Normally this is caused by enabling the option to preserve the source ids while importing into an already populated XF database. ie you created groups in XF beyond the default groups, then imported with the source id option enabled. The XF forum needs to be empty to use the source id option. Otherwise you can get collisions like this.
 

CyclingTribe

Well-known member
#4
Ah, yes, sorry, hadn't thought about it that way - so if the XF default ID's already exist ... the incoming usergroups with the same ID's will clash and halt the process. Nice one Jake. (y)
 
#5
Normally this is caused by enabling the option to preserve the source ids while importing into an already populated XF database. ie you created groups in XF beyond the default groups, then imported with the source id option enabled. The XF forum needs to be empty to use the source id option. Otherwise you can get collisions like this.
Thanks Jake.I had created another usergroup other than the default.When I deleted it.It worked.

First I was getting the same error as this person in this thread http://xenforo.com/community/threads/conversion-from-ip-board.33832/#post-385776

I followed your steps.Now I am getting this error in "Import Threads and Posts"

"Server Error

Mysqli statement execute error : Duplicate entry '4' for key 'PRIMARY'
  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  4. Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1591
  5. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1580
  6. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1381
  7. XenForo_DataWriter->save() in XenForo/Model/Import.php at line 580
  8. XenForo_Model_Import->_importData() in XenForo/Model/Import.php at line 1478
  9. XenForo_Model_Import->importThread() in XenForo/Importer/IPBoard.php at line 2604
  10. XenForo_Importer_IPBoard->stepThreads() in XenForo/Importer/Abstract.php at line 77
  11. XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 180
  12. XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 232
  13. XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 175
  14. XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 310
  15. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  16. XenForo_FrontController->run() in /home/creamy/public_html/admin.php at line 13"
How can I fix this?
 

Jake Bunce

XenForo moderator
Staff member
#6
The XF forum should have no threads or posts, otherwise you can get collisions like with the usergroups. Try deleting any threads / posts on your forum.
 
#7
The XF forum should have no threads or posts, otherwise you can get collisions like with the usergroups. Try deleting any threads / posts on your forum.
I searched every board and every sub-board.There was one thread.I pressed the delete button and I got an error.Now I searched for it and it is gone.I double checked.But still,I am getting the error.
 

Jake Bunce

XenForo moderator
Staff member
#8
What was the error on delete?

More generally, I recommend importing into a brand new XF forum without any content. Or run the import without enabling the option to preserve the source ids. That will avoid these errors.
 
#9
What was the error on delete?

More generally, I recommend importing into a brand new XF forum without any content. Or run the import without enabling the option to preserve the source ids. That will avoid these errors.
I have successfully completed the import.I created another user and gave him admin positions.Then I logged in from that account then I saw a thread which said that is visible to admins and moderators.I deleted it and it worked.
The error I got was "Your not allowed to delete".Do you know why I had got that before?Since I was the admin I am allowed to delete.