As part of product data migration from one store to another i need to change url keys on some of the products. Entire process is being done in shell script.
So imagine i used to have product with following url key:
nice-prod1 . It used to be in some category and whatnot. Now, after migration, it has become:
nice-prod2. It's accessible by it's new key so everything is fine. But the first one is not working anymore. So what I need, is to create url rewrites that redirect
I tried to achieve this using
setData('save_rewrites_history', true); before saving changes in product (which is part of collection), but no url rewrites are generated.