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

XF 1.1 Duplicate Entry Error on Import

#1
Hi,

I'm in the process of importing vB data into a fresh xF install; however, while trying to import users I'm getting the following error (it is set to overwrite the admin account with my own account from the vB install, both of which have the same name and password, but no other accounts exist on the xF install at this time):

Mysqli statement execute error : Duplicate entry '2' for key 1
  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 782
  8. XenForo_Model_Import->importUser() in XenForo/Importer/vBulletin.php at line 1220
  9. XenForo_Importer_vBulletin->_importUser() in XenForo/Importer/vBulletin.php at line 994
  10. XenForo_Importer_vBulletin->_importOrMergeUser() in XenForo/Importer/vBulletin.php at line 783
  11. XenForo_Importer_vBulletin->stepUsers() in XenForo/Importer/Abstract.php at line 77
  12. XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 180
  13. XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 232
  14. XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 175
  15. XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 310
  16. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  17. XenForo_FrontController->run() in /home/platinu/public_html/gates/admin.php at line 13
I have already imported this same data into a test board without incident, so I am not sure what the problem is this time around. I should probably note that this installation is occurring in the same location as where the vB install used to be (database is in-tact, files are not), if that has any bearing on the error.

Any help in getting this sorted would be greatly appreciated!

EDIT -- New information, it seems that after checking, two spam bots got through registration before I managed to turn it off (amazing feat, considering I literally did that seconds after finishing the install...), which I am assuming means importing valid user ids 2-3 won't be possible. Is there a way to purge these two entries from the DB without having to start over with a fresh install?
 
#2
Another piece of new information -- it turns out that somehow one of the bots managed to register before the admin account was created, giving it the userid 1, and making my userid 2. This seems to be causing a conflict with the user import. Is there a way to fix this, so that my userid reverts to 1?
 

Brogan

XenForo moderator
Staff member
#3
Are you able to restart the import?

That would be my suggestion - obviously disabling registrations first this time.
 
#4
I wound up deleting the new xf database and restarting, which worked. Thanks Brogan!

My only question remaining is how a user wound up being able to register while I was still in the install script setting up the Administrator account...
 

Brogan

XenForo moderator
Staff member
#5
I haven't actually tested it but it's possible that registrations are possible before the administrator account is created.

I will need to check on a localhost install.