3

When i trying to install data migration tool then getting this error in SSH

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Helper\ProgressBar::setFormat() must be of the type string, null given, called in /var/www/html/xyz/vendor/magento/data-migration-tool/src/Migration/App/ProgressBar/LogLevelProcessor.php on line 88 and defined in /var/www/html/xyz/vendor/symfony/console/Helper/ProgressBar.php:230

2 Answers 2

0

I had just the same issue recently, while migrating from 1.9.1.0 to 2.3.0 The problem is that method getProgressBar trying to get option progress_bar_format from config.xml under your Magento1 version's folder (in my case this is /vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.1.0/config.xml) to create progress bar that you can see while migration process in console.

/vendor/magento/data-migration-tool/src/Migration/App/ProgressBar/LogLevelProcessor.php

protected function getProgressBar()
{
    if (null == $this->progressBar) {
        $this->progressBar = $this->progressBarFactory->create($this->getOutputInstance());
        $this->progressBar->setFormat($this->config->getOption(self::PROGRESS_BAR_FORMAT_OPTION));
    }
    return $this->progressBar;
}

But method $this->config->getOption(self::PROGRESS_BAR_FORMAT_OPTION)); didn't get option and returned null, that's because:

/vendor/magento/data-migration-tool/src/Migration/Config.php

public function getOption($name)
{
    return isset($this->options[$name]) ? $this->options[$name] : null; <-- '' instead of null
}

So i just replaced null to empty strig '', to get default progress bar. And it helped.

0

I had the same issue migrating from 1.9.1.1 to 2.4.5 caused by me not specifying the config file on the command line.

bin/magento migrate:data /path/to/config.xml

https://experienceleague.adobe.com/docs/commerce-operations/tools/data-migration/migrate-data/overview.html

@Kirill I wouldn't recommend changing the source of /vendor/magento/data-migration-tool/src/Migration/Config.php to return an empty string instead of null when options are not set. That may have unintended consequences because every unset config option will now return an empty string instead of null. (Can't add as a comment as rep too low.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.