XF 2.1 Import Failed with 2 Errors

JamesAus

Active member
I'm doing an import from the command line and its failed with this:

php cmd.php xf:import --processes=4
Starting import from vBulletin 4.x...
Using parallel runner with up to 4 processes.
Note: completion percentage is approximate and only updated periodically.
- Step 16 of 26: Posts 00:36:42 [3,022,838] 61.27%
In ParallelProcessManager.php line 170:

Child process exited with code 1. See control panel error error logs for details.

xf:import [--processes PROCESSES] [--finalize]
Going into my Admin Control Panel, I see this. Any ideas what I need to do?
#0 src/XF/Import/ParallelRunner.php(55): XF\Import\ParallelProcessManager->execute(Object(XF\Import\Manager), Object(Closure))
#1 src/XF/Import/Runner.php(128): XF\Import\ParallelRunner->runUntilCompleteInternal(Object(XF\Import\Manager), Object(Closure))
#2 src/XF/Cli/Command/Import.php(145): XF\Import\Runner->runUntilComplete(Object(XF\Import\Manager), Object(Closure))
#3 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\Import->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 src/vendor/symfony/console/Application.php(987): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\Import), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 src/XF/Cli/Runner.php(63): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 cmd.php(15): XF\Cli\Runner->run()
#9 {main}
array(1) {
["cli"] => string(31) "cmd.php xf:import --processes=4"
}
INSERT INTO xf_post (post_id, thread_id, user_id, username, post_date, message, ip_id, message_state, attach_count, warning_id, warning_message, position, last_edit_date, last_edit_user_id, edit_count, embed_metadata, reaction_score, reactions, reaction_users) 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(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(222): XF\Db\AbstractAdapter->query('INSERT INTO `x...', Array)
#4 src/XF/Import/Data/EntityEmulator.php(326): XF\Db\AbstractAdapter->insert('xf_post', Array)
#5 src/XF/Import/Data/AbstractEmulatedData.php(55): XF\Import\Data\EntityEmulator->insert(3099010, Object(XF\Db\Mysqli\Adapter))
#6 src/XF/Import/Data/AbstractData.php(127): XF\Import\Data\AbstractEmulatedData->write(3099010)
#7 src/XF/Import/Importer/StepPostsTrait.php(139): XF\Import\Data\AbstractData->save(3099010)
#8 src/XF/Import/Runner.php(231): XFI\Import\Importer\vBulletin->stepPosts(Object(XF\Import\StepState), Array, 8)
#9 src/XF/Import/ParallelRunner.php(212): XF\Import\Runner->runStep('posts', Object(XF\Import\StepState), 8)
#10 src/XF/Cli/Command/ImportChildProcess.php(78): XF\Import\ParallelRunner->runChildProcess('posts', 60000, 63000, Object(Closure))
#11 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\ImportChildProcess->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 src/vendor/symfony/console/Application.php(987): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\ImportChildProcess), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 src/XF/Cli/Runner.php(63): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 cmd.php(15): XF\Cli\Runner->run()
#17 {main}

  • XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '3099010' for key 'PRIMARY'
  • src/XF/Db/AbstractStatement.php:228
  • Generated by: Unknown account
  • Jul 17, 2020 at 11:07 PM
array(1) {
["cli"] => string(87) "/home/cricketweborg/public_html/forum/cmd.php xf:import-child-process posts 60000 63000"
}
 
This week I was testing a command line import and for no fault of its own (disk full), it crashed. I fixed the problem and ran the importer again, and it continued where it left off, but immediately had the same error. In the target DB, I deleted the post # it identified as duplicate. Then I started up the CLI again and the importer continued on its happy way...

I don't know if that will solve your problem and its been a few days so you might have restarted, but in any case, if it happens (again) maybe try deleting post # 3099010 from xf_post and then immediately running php cmd.php xf:import again.

Also, I see you are importing from vBulletin 4.x. My experience has been with importing from vbul 3.x, but maybe this is helpful... I had a few duplicate records (like multiple accounts with the same email). The importer really didn't like that, but didn't bother to complain until the end. I can't imagine post number isn't a unique ID in vbul 4, but if you continue to have issues, maybe check the source DB.
 
Thanks for your response PlayerOne.

Yes, I finished up re-running the importer too and it seemed to continue on just fine. I was wondering whether something nasty was going to crop up in the future.
 
Back
Top Bottom