Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script stops at step: data migration][step: Url Rewrite Step #46

Closed
andidhouse opened this issue Jan 11, 2016 · 5 comments
Closed

Script stops at step: data migration][step: Url Rewrite Step #46

andidhouse opened this issue Jan 11, 2016 · 5 comments

Comments

@andidhouse
Copy link

We are working on the migration from 1.7.0.2 to 2.0.
Now we have a problem that the script just stops at the "URL Rewrite Step" - always at exact 24%!

No error logs are shown and just the notice: [ErrorException] Undefined offset: 0

[2016-01-11 16:40:15][INFO][mode: data][stage: data migration][step: Url Rewrite Step]: started

24% [======>---------------------] Remaining Time: 25 secs

How can we debug this?

We also noticed that our source database has two entries of rewrite tables:

  • core_url_rewrite
  • core_url_rewrite_backup

Could this be a problem?

If we empty the core_url_rewrite table the migration works fine but of course all urls are messed up.
Is there maybe a way to rebuild the urls internaly by magento 2.0 itself. We als realized that the core_url_rewrite table is quite huge and also has stored some very old data.

Many thanks!

@andidhouse
Copy link
Author

2
1

@victor-v-rad
Copy link
Collaborator

Hi,

How can we debug this?

Try to run the migration with -vvv option like this:
php bin/magento migrate:data /var/www/magento2/vendor/magento/data-migration-tool/etc/ce-to-ce/1.7.0.2/config.xml -vvv
it should show the trace of the error

@andidhouse
Copy link
Author

HI Victor,
many thanks for the advice.

The output is:

Exception trace:
() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Step/UrlRewrite/Version191to2000.php:280
Composer\Util\ErrorHandler::handle() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Step/UrlRewrite/Version191to2000.php:280
Migration\Step\UrlRewrite\Version191to2000->transform() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Step/UrlRewrite/Version191to2000.php:193
Migration\Step\UrlRewrite\Version191to2000->data() at n/a:n/a
call_user_func() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Step/UrlRewrite/Version191to2000.php:225
Migration\Step\UrlRewrite\Version191to2000->perform() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Mode/AbstractMode.php:73
Migration\Mode\AbstractMode->runStage() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:116
Migration\Mode\Data->runData() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:68
Migration\Mode\Data->run() at /var/www/html/magento2/var/generation/Migration/Mode/Data/Proxy.php:95
Migration\Mode\Data\Proxy->run() at /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Console/MigrateDataCommand.php:51
Migration\Console\MigrateDataCommand->execute() at /var/www/html/magento2/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at /var/www/html/magento2/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/magento2/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at /var/www/html/magento2/vendor/magento/framework/Console/Cli.php:49
Magento\Framework\Console\Cli->doRun() at /var/www/html/magento2/vendor/symfony/console/Symfony/Component/Console/Application.php:126

Symfony\Component\Console\Application->run() at /var/www/html/magento2/bin/magento:25

Looking at the file /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Step/UrlRewrite/Version191to2000.php line 280 and this code causes the error:

$destRecord->setValue('redirect_type', $this->redirectTypesMapping[$record->getValue('options')]);

Any idea how to fix this?

We applied a change in this file but i think this could not lead to the problem right?
https://github.com/magento/data-migration-tool-ce/pull/25/files

@andidhouse
Copy link
Author

We solved this problem by deleting any custom urls (generated by some extensions) in the source database:

delete from core_url_rewrite where is_system = 0;

Maybe this would be great to implement this in the tool as this causes the problem.

@victor-v-rad
Copy link
Collaborator

this code causes the error:
$destRecord->setValue('redirect_type', $this->redirectTypesMapping[$record->getValue('options')]);
Any idea how to fix this?

Internal issue MAGETWO-47890 was created for properly validation of core_url_rewrite.options filed to prevent such errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants