Wordpress database, SQL to change categories

Hi,
I have a bunch of woocommerce products for which I want to change the category id’ to some new ones I have created. I think the product categories are stored just like post categories in the wp_term_relationships table?
Basically I think I want to run a query that says in the wp_term_relationships table where the term_taxonomy_id = 2 change it to 10

UPDATE wp_term_relationships 
   SET term_taxonomy_id = 10
 WHERE term_taxonomy_id = 2

thanks very much :slight_smile: