I'm trying to import product reviews with ratings from old magento site to new site. I've almost done. But I'm getting struck at setting remote ip address for rating?

When I searched the rating module I could not see any function to set this. This IP address is set by core module(Mage/Core/Model/http.php).

How can I set this? Do I want to write my own function?

1 Answer 1


When adding votes using the function Mage_Rating_Model_Resource_Rating_Option::addVote the ip will be set from Mage::helper('core/http')->getRemoteAddr() on creation of entity but not on update.

So from what I see here you have two options.

  1. Create your own function for adding votes and ignore the automatic setting of ip,
  2. Call the add twice once to insert and then once more to update,
  3. Import the items directly in sql,

I would suggest that maybe the first option would be good for you, since this appears to be an import more than a creation of new reviews, though if this is the case it might also be worth investigating creating your own import script and simply dealing directly with all the appropriate models or and even scarier option would be to import directly to mysql.....but do not do this unless you have backups and knowledge of what you are doing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.