Fixed [vB5 Import] Data too long for column 'old_id' at row 1

Viper007Bond

New member
Affected version
2.0.2
I'm doing a test run locally of importing my vB5 forum into XenForo and I got the following error via CLI:

Code:
 - Step  9 of 26: Profile comments          00:01:09 [7,607]


  [XF\Db\Exception]
  MySQL query error [1406]: Data too long for column 'old_id' at row 1

I modified the log table's column to have a length of 255 instead of 50 and that seems to have fixed the issue.
 
I'm assuming this is due to the way XF attempts to read the node name so that links can be maintained in the same way as vB5 does... perhaps we need to extend the length of the field to handle this.
 
That's quite feasible.

For existing import log tables, you'd need to run the following query to fix the length of your ID fields:
SQL:
ALTER TABLE `<YOUR IMPORT LOG TABLE NAME>`
MODIFY COLUMN `old_id` VARBINARY(50) NOT NULL,
MODIFY COLUMN `new_id` VARBINARY(50) NOT NULL
 
Sorry, I should have been more clear. This was with a brand new fresh import into an empty database. The log table didn't exist.

I first discovered the error on my local machine where I was testing importing inside some Docker containers but I got the error again on my production server when doing another test import.
 
Code:
root@1e66089be334:/var/www/html/public# php cmd.php xf:import --verbose
Starting import from vBulletin 5.x (Beta)...
 - Importing... (< 1 sec)

  [XF\Db\Exception]
  MySQL query error [1406]: Data too long for column 'old_id' at row 1


Exception trace:
 () at /var/www/html/public/src/XF/Db/AbstractStatement.php:212
 XF\Db\AbstractStatement->getException() at /var/www/html/public/src/XF/Db/Mysqli/Statement.php:196
 XF\Db\Mysqli\Statement->getException() at /var/www/html/public/src/XF/Db/Mysqli/Statement.php:77
 XF\Db\Mysqli\Statement->execute() at /var/www/html/public/src/XF/Db/AbstractAdapter.php:79
 XF\Db\AbstractAdapter->query() at /var/www/html/public/src/XF/Db/AbstractAdapter.php:160
 XF\Db\AbstractAdapter->insert() at /var/www/html/public/src/XF/Import/Log.php:117
 XF\Import\Log->log() at /var/www/html/public/src/XF/Import/DataManager.php:116
 XF\Import\DataManager->log() at /var/www/html/public/src/addons/XFI/Import/Importer/vBulletin5.php:531
 XFI\Import\Importer\vBulletin5->logExtraForumData() at /var/www/html/public/src/addons/XFI/Import/Importer/vBulletin.php:2105
 XFI\Import\Importer\vBulletin->importNodeTree() at /var/www/html/public/src/addons/XFI/Import/Importer/vBulletin.php:2116
 XFI\Import\Importer\vBulletin->importNodeTree() at /var/www/html/public/src/addons/XFI/Import/Importer/vBulletin.php:2116
 XFI\Import\Importer\vBulletin->importNodeTree() at /var/www/html/public/src/addons/XFI/Import/Importer/vBulletin.php:2026
 XFI\Import\Importer\vBulletin->stepForums() at /var/www/html/public/src/XF/Import/Runner.php:160
 XF\Import\Runner->runStep() at /var/www/html/public/src/XF/Import/Runner.php:74
 XF\Import\Runner->run() at /var/www/html/public/src/XF/Cli/Command/Import.php:66
 XF\Cli\Command\Import->execute() at /var/www/html/public/src/vendor/symfony/console/Command/Command.php:242
 Symfony\Component\Console\Command\Command->run() at /var/www/html/public/src/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/public/src/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at /var/www/html/public/src/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/html/public/src/XF/Cli/Runner.php:63
 XF\Cli\Runner->run() at /var/www/html/public/cmd.php:15
 
I'm importing my forum from vBulletin 5.3.3 to XF 2.0.4 and i just had the same issue, i fixed it by changing column max length for old_id and new_id from 50 to 128
 
That's quite feasible.

For existing import log tables, you'd need to run the following query to fix the length of your ID fields:
SQL:
ALTER TABLE `<YOUR IMPORT LOG TABLE NAME>`
MODIFY COLUMN `old_id` VARBINARY(50) NOT NULL,
MODIFY COLUMN `new_id` VARBINARY(50) NOT NULL

How do you work on this if the import has not started yet? The log table doesnt exist yet.
So that it wont stop during actual migration?
 
I have the same problem. can someone help me to fix it?

XF\Db\Exception: MySQL query error [1406]: Data too long for column 'old_id' at row 1 in src/XF/Db/AbstractStatement.php at line 228
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 77
  3. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 218
  5. XF\Db\AbstractAdapter->insert() in src/XF/Import/Log.php at line 117
  6. XF\Import\Log->log() in src/XF/Import/DataManager.php at line 116
  7. XF\Import\DataManager->log() in src/addons/XFI/Import/Importer/vBulletin5.php at line 552
  8. XFI\Import\Importer\vBulletin5->logExtraForumData() in src/addons/XFI/Import/Importer/vBulletin.php at line 2197
  9. XFI\Import\Importer\vBulletin->importNodeTree() in src/addons/XFI/Import/Importer/vBulletin.php at line 2205
  10. XFI\Import\Importer\vBulletin->importNodeTree() in src/addons/XFI/Import/Importer/vBulletin.php at line 2205
  11. XFI\Import\Importer\vBulletin->importNodeTree() in src/addons/XFI/Import/Importer/vBulletin.php at line 2118
  12. XFI\Import\Importer\vBulletin->stepForums() in src/XF/Import/Runner.php at line 242
  13. XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 59
  14. XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line 234
  15. XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.php at line 350
  16. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  17. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  18. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  19. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2326
  20. XF\App->run() in src/XF.php at line 488
  21. XF::runApp() in admin.php at line 13
 
We can only provide support to licensed customers. If you are licensed, please add your forum username to the Forum users page in your Account area and then post in the correct forum.
 
Top Bottom