magento / magento/data-migration-tool

Duplicate URL rewrites

Open
#606 3 comments 0 reactions 0 assignees View on GitHub
acknowledged bug
Dominant language
PHP
Stars
339
Forks
195
PR merge metrics
No merged PRs in 30d

Description

I'm having an issue with custom url rewrites. The problem I have is that - we have a number of products that exist in Magento back end which are no longer visible on the front end.
We have put custom url rewrites for that product to another category, so that the link is now following properly by google or people who have saved links or old emails.
Data migration tool thinks these are duplicates.

Another example is that we have a product with a url key of **cordless-vacuum-cleaner**. We don't want to use the product page for now, so we have put a url redirect from **cordless-vacuum-cleaner** to **some-cms-page** (a CMS page).

But when converting the db from m1 to db, we get duplicate URL rewrite issue:

```
Request path: cordless-vacuum-cleaner Store ID: 31 Target path: some-cms-page
Request path: cordless-vacuum-cleaner Store ID: 31 Target path: catalog/product/view/id/11238
```

What is the solution here?

I have used the code for https://github.com/magento/data-migration-tool/issues/77 here in the past, which gets past this issue, but then none of my custom url redirects work any more.

### Preconditions

1. Magento 1.14.3.10
2. Magento 2.2.6
3. PHP 7.1.23
4. MySQL 5.7.24

### Steps to reproduce
1. Have a magento product with a url key of s7-duet-master-steam-cleaner
2. Put in a custom URL rewrite for s7-duet-master-steam-cleaner that re-directs to another category
3. Run data migration tool conversion
4. Stops running on 'There are duplicates in URL rewrites'

### Expected result
1. There isn't any duplicates

### Actual result
```
[2018-11-06 08:53:22][ERROR]: There are duplicates in URL rewrites:
Request path: s7-duet-master-steam-cleaner Store ID: 3 Target path: steam-cleaners
Request path: s7-duet-master-steam-cleaner Store ID: 3 Target path: catalog/product/view/id/2668
```

Contributor guide

Open the contributing guide

Research direction

Start with the data migration tool's URL rewrite conversion step and reproduce the duplicate check using the stated Magento, PHP, and MySQL versions. Trace how the two rewrites for the same request path and store are handled; done means conversion completes while the custom redirect remains functional.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.