Fixed Error in Step 2 of Importer (CLI) for VB4

fotografik

Active member
Affected version
XF2
Received the following error while trying a test import using the CLI interface (after following all the instructions on the browser):-

InvalidArgumentException: Unknown column 'match_regex'

Additional server error data below:-
Stack trace
#0 src/XF/Import/Data/AbstractEmulatedData.php(24): XF\Import\Data\EntityEmulator->set('match_regex', '^[A-Z ]+$', Array)
#1 src/XF/Import/Data/AbstractData.php(70): XF\Import\Data\AbstractEmulatedData->set('match_regex', '^[A-Z ]+$', Array)
#2 src/XF/Import/Importer/vBulletin.php(694): XF\Import\Data\AbstractData->bulkSet(Array)
#3 src/XF/Import/Runner.php(161): XF\Import\Importer\vBulletin->stepUserFields(Object(XF\Import\StepState), Array, 8)
#4 src/XF/Import/Runner.php(75): XF\Import\Runner->runStep('userFields', Object(XF\Import\StepState), 8)
#5 src/XF/Cli/Command/Import.php(64): XF\Import\Runner->run()
#6 src/vendor/symfony/console/Command/Command.php(242): XF\Cli\Command\Import->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 src/vendor/symfony/console/Application.php(843): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 src/vendor/symfony/console/Application.php(194): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\Import), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 src/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 src/XF/Cli/Runner.php(63): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 cmd.php(15): XF\Cli\Runner->run()
#12 {main}
Request state
array(4) {
["url"] => string(0) ""
["referrer"] => bool(false)
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
This looks to be a bug but if you're comfortable with editing the code then the following should fix it for now. You need to find the file src/XF/Import/Importer/vBulletin.php and then find the line:
PHP:
$data['match_regex'] = $field['regex'];
And replace it with:
PHP:
$data['match_params']['regex'] = $field['regex'];
 
This looks to be a bug but if you're comfortable with editing the code then the following should fix it for now. You need to find the file src/XF/Import/Importer/vBulletin.php and then find the line:
PHP:
$data['match_regex'] = $field['regex'];
And replace it with:
PHP:
$data['match_params']['regex'] = $field['regex'];

Did the code change and it did get through Step 2. However, the VB4 importer is very slow ... took 15 minutes to parse 5% of the users at which point I stopped the import :(

I will have to try the VB4 > XF1.5 via the Big Board Import addon and then update to XF2.
 
Did the code change and it did get through Step 2. However, the VB4 importer is very slow ... took 15 minutes to parse 5% of the users at which point I stopped the import :(

I will have to try the VB4 > XF1.5 via the Big Board Import addon and then update to XF2.
I've applied the fix to the regex code.

I'm wondering why you found the importer so slow - were you importing from a source database on the same server as the destination XenForo database, or was the data flowing over the Internet? Is the server of a decent spec? Any information you can provide might be helpful.
 
I've applied the fix to the regex code.

I'm wondering why you found the importer so slow - were you importing from a source database on the same server as the destination XenForo database, or was the data flowing over the Internet? Is the server of a decent spec? Any information you can provide might be helpful.
We are running on an AWS environment. Source is an RDS instance and destination is another RDS instance. Both RDS instances are in the same zone, and have been sized similarly.
 
It's very likely that latency is an issue there -- the importer will be running 10s or 100s of thousands of queries per step. It tends to be better to run them in single server environments to avoid the latency elements. (Obviously you can then deploy to a different configuration.)
 
Top Bottom