Based on script by "Magento Craftsman in Melbourne": https://blog.mdnsolutions.com/migrate-products-reviews-and-ratings-programmatically/
The steps below will export product reviews at "source" server and import the same reviews into magento at "destination" server.
-
Connect to the "source" server. (If your server allows remote mysql connections you can do the steps 2-6 from local environment.)
-
Copy export-reviews.sql to home directory.
-
Export reviews to
~/reviews.csv
file:mysql db -u root --password=123 < ~/export-reviews.sql | sed "s/\"/\"\"/;s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/" > ~/reviews.csv
-
Open
~/reviews.csv
and check if everything is fine. -
Change sku's to match sku's at "destination" server.
-
Take a look at the column titles in
~/reviews.csv
. Make sure that__x__
inrating__x__value
column names matches destination rating ids. -
Save changes to
~/reviews.csv
-
Connect to the "destination" server.
-
Copy import-reviews.php to
MAGENTO_ROOT/shell
. -
Copy
~/reviews.csv
toMAGENTO_ROOT/shell
folder and run the following command:php -f import-reviews.php -- -file reviews.csv
Verify Github on Galaxy. gid:v96FAFMzxhDnRnCamV5epX