Hi,
You can do that in one go with a mass action.
Go in the menu System > Mass actions of HikaShop and create a new mass action with :
- Table : products
- Filter : add a filter on the "category" table and select the categories you moved, so that only the products of these categories are processed. If all the canonical URLs of your products were generated automatically anyway, you can simply add no filter at all and process all the products.
- Action : "Set canonical url", and leave its text field completely empty.
Then save and run the mass action. That action writes the value you enter in the canonical URL field of each product matching the filter, so with an empty value it just empties them all.
After that, since your setting "Force canonical URLs on listings" is set to "Use canonical URL and generate it if missing", HikaShop will store a new canonical URL on each product, based on your new category structure, the next time the page of the product is displayed on the front end.
One thing which is worth knowing, and which explains the error pages you see : that stored canonical URL is not only used for the canonical tag in the head of the page, it is also used to build the links to the products in the product listings. So as long as a product keeps an obsolete canonical URL, the link to that product in your listings points to the obsolete URL too. Emptying the field fixes both at once.
If the categories themselves also have an obsolete canonical URL, you can do the same with a second mass action on the table "categories", with the action "Update values", the column "category_canonical" and an empty value.
Finally, to avoid the situation happening again the next time you reorganize your categories, you can set "Force canonical URLs on listings" to "Use canonical URL if specified" in the configuration (tab Features, section "SEF URL options"). With that setting, HikaShop still adds a canonical tag on the pages, but it generates it from the current URL of the page instead of storing it in the database, so it always follows your current category structure. Only the canonical URLs you type yourself in the SEO area of a product are then used. Note also that with your current setting, the URL which gets stored is the first URL a visitor happened to use to reach the product, which is not necessarily the one you would have chosen.