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

Affected version
2.0.2
#1
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.
 

Kier

XenForo Developer
Staff member
#2
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.
 

Chris D

XenForo developer
Staff member
#5
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
 
#6
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.
 
#7
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
 
#8
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
 
Top