XF 2.0 Import error

BoyG

Member
Got this error when importing my test database.

XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '6967435' for key 'PRIMARY' in src/XF/Db/AbstractStatement.php at line 212
  1. XF\Db\AbstractStatement->getException() insrc/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() insrc/XF/Db/Mysqli/Statement.php at line 78
  3. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.phpat line 79
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 161
  5. XF\Db\AbstractAdapter->insert() insrc/XF/Import/Data/EntityEmulator.php at line 320
  6. XF\Import\Data\EntityEmulator->insert() insrc/XF/Import/Data/AbstractEmulatedData.php at line 39
  7. XF\Import\Data\AbstractEmulatedData->write() insrc/XF/Import/Data/AbstractData.php at line 126
  8. XF\Import\Data\AbstractData->save() insrc/addons/XFI/Import/Importer/vBulletin.php at line 3105
  9. XFI\Import\Importer\vBulletin->stepPosts() insrc/XF/Import/Runner.php at line 160
  10. XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 74
  11. XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line232
  12. XF\Admin\Controller\Import->actionRun() insrc/XF/Mvc/Dispatcher.php at line 249
  13. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line89
  14. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line41
  15. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  16. XF\App->run() in src/XF.php at line 328
  17. XF::runApp() in admin.php at line 13
Any help would be appreciated.
 

BoyG

Member
Here is the server error log:
  • XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '6967435' for key 'PRIMARY'
  • src/XF/Db/AbstractStatement.php:212
Stack trace
INSERT INTO `xf_post` (`post_id`, `thread_id`, `user_id`, `username`, `post_date`, `message`, `ip_id`, `message_state`, `attach_count`, `likes`, `like_users`, `warning_id`, `warning_message`, `position`, `last_edit_date`, `last_edit_user_id`, `edit_count`, `embed_metadata`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(78): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(79): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(161): XF\Db\AbstractAdapter->query('INSERT INTO `x...', Array)
#4 src/XF/Import/Data/EntityEmulator.php(320): XF\Db\AbstractAdapter->insert('xf_post', Array)
#5 src/XF/Import/Data/AbstractEmulatedData.php(39): XF\Import\Data\EntityEmulator->insert(6967435, Object(XF\Db\Mysqli\Adapter))
#6 src/XF/Import/Data/AbstractData.php(126): XF\Import\Data\AbstractEmulatedData->write(6967435)
#7 src/addons/XFI/Import/Importer/vBulletin.php(3105): XF\Import\Data\AbstractData->save(6967435)
#8 src/XF/Import/Runner.php(160): XFI\Import\Importer\vBulletin->stepPosts(Object(XF\Import\StepState), Array, 8)
#9 src/XF/Import/Runner.php(74): XF\Import\Runner->runStep('posts', Object(XF\Import\StepState), 8)
#10 src/XF/Admin/Controller/Import.php(232): XF\Import\Runner->run()
#11 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\Import->actionRun(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Import', 'run', 'html', Object(XF\Mvc\ParameterBag), 'importData', Object(XF\Admin\Controller\Import), NULL)
#13 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#15 src/XF.php(328): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}
Request state
array(4) {
["url"] => string(21) "/admin.php?import/run"
["referrer"] => string(54) "http://dev.motorcyclephilippines.com/admin.php?import/"
["_GET"] => array(1) {
["import/run"] => string(0) ""
}
["_POST"] => array(1) {
["_xfToken"] => string(8) "********"
}
}
 

Earl

Active member
Which step was running while you getting this error? Threads/ posts/ Users?

And you are importing from?
 
Last edited:

BoyG

Member
resolved by deleting the duplicate entry via phpmyadmin.
also imported my vb4 forum by going through version 1.5 before upgrading to 2
 
Top