The new UNIQUE index of Magento CE 1.8 changes the URL keys in the URL rewrite table. If you have multiple store views and import your products, (so that for each store view the URL key is saved) you automatically have duplicated keys. The update script is smart enough to not throw an error, but to rename all the keys so you’ll end up with something like:
- http://de.example.com/someproduct.html
- http://en.example.com/someproduct1.html
- http://nl.example.com/someproduct2.html
To avoid that, the URL rewrites have to be fixed before the update so that there is one rewrite per product and URL key, and the store views use “Use default”. You can manage that with a single SQL query before the update:
DELETE nondefault
FROM catalog_product_entity_varchar AS nondefault
INNER JOIN catalog_product_entity_varchar AS def ON def.value = nondefault.value
AND def.entity_id = nondefault.entity_id
WHERE def.attribute_id =86
AND nondefault.attribute_id =86
AND nondefault.store_id <>0
AND def.store_id =0
Note that 86 is the ID of the URL key attribute. If you already have updated your system without running this query first, you have to remove the wrongly created URL keys first. This can be done with the following query:
DELETE url_table
FROM catalog_product_entity_url_key url_table
INNER JOIN catalog_product_entity_varchar old_url_table ON url_table.store_id = old_url_table.store_id
AND url_table.store_id <>0
AND old_url_table.store_id <>0
AND url_table.attribute_id = old_url_table.attribute_id
AND url_table.entity_id = old_url_table.entity_id;
I hope this helps! The following link might help you if you have further questions:
http://www.code4business.de/update-magento-enterprise-edition-1-13-0-2/