magento / magento/data-migration-tool

URL Rewrite error/rollback during migration 2.3.4

Open
#794 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
339
Forks
195
PR merge metrics
No merged PRs in 30d

Description

Similar issue in https://github.com/magento/data-migration-tool/issues/745 but different version and older issue.

### Preconditions

1. Magento CE 1.9.3.1
2. Magento 2.3.4
3. PHP 7.4
4. Server version: 5.7.29-0ubuntu0.18.04.1 (Ubuntu)

### Steps to reproduce

1. Clean database in both MG. Any in production because are in develop mode and trying tool
2. MG is in develop mode. Not crons.
3. Use [official docs](https://devdocs.magento.com/guides/v2.3/migration/migration-tool-install.html)

### Expected result

1. On steep **migrate:data** get error

```
[2020-02-06 19:17:37][INFO][mode: data][stage: volume check][step: Url Rewrite Step]: started
0% [>---------------------------] Remaining Time: < 1 sec
100% [============================] Remaining Time: < 1 sec
[2020-02-06 19:17:38][INFO][mode: data][stage: volume check][step: Url Rewrite Step]: Error occurred. Rollback.
[2020-02-06 19:17:38][INFO][mode: data][stage: volume check][step: Url Rewrite Step]: Url Rewrite Step: rollback
[2020-02-06 19:17:38][INFO][mode: data][stage: volume check][step: Url Rewrite Step]: Please fix errors and run Migration Tool again
[2020-02-06 19:17:38][WARNING]: Volume Check failed
[2020-02-06 19:17:38][INFO][mode: data][stage: data migration][step: Log Step]: started
[2020-02-06 19:17:38][DEBUG][mode: data][stage: data migration][step: Log Step][table: log_visitor]: migrating

```
2. Try `remove the words implements RollbackInterface from Migration\Step\UrlRewrite\Version191to2000 class`
3. Restore all databases from backups (fresh install without any data of migration) in both databases (mg1 and mg2)
4. Re-run with debug
```
magento migrate:settings -vvv /home/tienda/tienda_develop/magento/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.1/config.xml && magento migrate:data -vvv /home/tienda/tienda_develop/magento/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.1/config.xml
```

-vvv not show any special or debug information aditional (sic)

### Actual result

```
[2020-02-07 11:12:18][INFO][mode: data][stage: volume check][step: Url Rewrite Step]: started
0% [>---------------------------] Remaining Time: < 1 sec
100% [============================] Remaining Time: < 1 sec
[2020-02-07 11:12:18][WARNING]: Volume Check failed
[2020-02-07 11:12:18][INFO][mode: data][stage: data migration][step: Log Step]: started
[2020-02-07 11:12:19][DEBUG][mode: data][stage: data migration][step: Log Step][table: log_visitor]: migrating
```

### Additional notes

After migration, thre're aditional problems about
```
1 exception(s):
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Default store is inactive

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Default store is inactive

#1 Magento\Store\Model\StoreResolver->getCurrentStoreId() called at [vendor/magento/module-store/Model/StoreManager.php:160]

#2 Magento\Store\Model\StoreManager->getStore() called at [generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:119]
#3 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() called at [vendor/magento/module-store/Model/Resolver/Store.php:30]
#4 Magento\Store\Model\Resolver\Store->getScope() called at [vendor/magento/framework/App/Config/ScopeCodeResolver.php:49]
#5 Magento\Framework\App\Config\ScopeCodeResolver->resolve() called at [vendor/magento/framework/App/Config.php:69]
#6 Magento\Framework\App\Config->getValue() called at [vendor/magento/module-backend/App/Area/FrontNameResolver.php:123]
#7 Magento\Backend\App\Area\FrontNameResolver->isHostBackend() called at [vendor/magento/module-backend/App/Area/FrontNameResolver.php:106]
#8 Magento\Backend\App\Area\FrontNameResolver->getFrontName() called at [vendor/magento/framework/App/AreaList.php:73]
#9 Magento\Framework\App\AreaList->getCodeByFrontName() called at [vendor/magento/framework/App/Http.php:111]
#10 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#11 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#12 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]

```

For correct it I need...
```
UPDATE tienda_ovh.st1_store SET is_Active = 1 WHERE store_id = 1;
UPDATE `tienda_ovh`.`st1_core_config_data` SET `value` = '1' WHERE (`config_id` = '6');
UPDATE `tienda_ovh`.`st1_core_config_data` SET `value` = '1' WHERE path like '%web/secure/use_in_adminhtml%';
```

MG1 -> core_url_rewrite has 310572 rows
MG2 -> url_rewrite has 309215 rows
--------> cms_page has 33 rows.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Migration\Step\UrlRewrite\Version191to2000 and the migrate:data command using the referenced config.xml. Reproduce the volume-check rollback on the stated Magento, PHP, and MySQL versions, then compare the behavior and row counts of core_url_rewrite and url_rewrite. Done means the migration no longer fails at the URL Rewrite step.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.