You will need to join four tables to get categories of custom post type “review”
- wp_term_relationships
- wp_posts
- wp_term_taxonomy
- wp_terms
by using following query you can get list of categories applied to your custom post type:
SELECT *
FROM wp_term_relationships AS tr
LEFT JOIN wp_posts AS p ON tr.object_id = p.ID
LEFT JOIN wp_term_taxonomy AS tt ON tt.term_taxonomy_id = tr.term_taxonomy_id
LEFT JOIN wp_terms AS t ON t.term_id = tt.term_id
WHERE p.post_type="review" AND tt.taxonomy = 'category';
and then update the type of these categories to your new custom category (i.e. “review-category”)
UPDATE wp_term_taxonomy SET taxonomy = 'review-category' WHERE term_taxonomy_id IN (1, 71, 72);
change where clause according to your category ids.
For more information visit following WordPress documentation links:
Database_Description
WordPress_Taxonomy