Close

February 25, 2014

Moving Reviews from One Product to Another In Magento

On an enterprise magento client, we’ve recently had a need to move customer reviews from one product to another. The original product had custom options on it, that needed to made into a bundle, so the reviews had to go along with it.

We found post an StackOverflow that pointed us in the right direction. It showed how to move the actual customer review, but not any of the rating data. While we hate working directly in the database itself, there didn’t appear to be any better way of moving review and rating data. Below are the three SQL queries that we used to migrate the reviews. You’ll have to find the actual product id’s via the magento admin tool.

NOTE:  USE THESE AT YOUR OWN RISK!  They modify tables directly in the database and should be tested on a development environment before.  You have to know what you are doing!

update review set entity_pk_value = NEWPRODUCT_ID where entity_pk_value = OLDPRODUCT_ID;
update rating_option_vote set entity_pk_value = NEWPRODUCT_ID where entity_pk_value = OLDPRODUCT_ID;
update rating_option_vote_aggregated set entity_pk_value = NEWPRODUCT_ID where entity_pk_value = OLDPRODUCT_ID;

UPDATE 4/30/2014 Make sure you edit a test review in both products and hit save. This will for the aggregate review calculate to run. Otherwise, the reviews will move, but the product pages will still show the old amount of reviews on the page.