Issue
- Ratings and Comment Ratings are enabled in our portal.
- When we upgrade the portal from 6.2 to 7.3, some likes turn into dislikes and that creates false information.
- In the ratingsentry table, the scores of the ratings change from 1 (before upgrade) to 0.2 (after the upgrade).
Environment
- Liferay Portal 6.2
- Liferay DXP 7.3
Resolution
The reason why the rating scores go down from 1 to 0.2 during the upgrade is that they are getting normalized with the star ratings (1-5). The default normalization factor is 5, so the rating values will be divided by 5 (1/5 = 0.2).
-
Solution pre-upgrade: Set
ratings.upgrade.stars.normalization.factor[default]=1
in portal-upgrade-ext.properties in the upgrade tool, and re-run the 6.2 to 7.3 upgrade.
-
Solution post-upgrade:
- Make sure that you take a backup of your database dump before running any script that modifies the entries
- Navigate to Control Panel > Server Administration > Script
- Paste the attached groovy script there and Execute
- When it's finished, navigate to Control Panel > Server Administration >Resources
- Clear the database cache
After this, you should see the correct number of likes and dislikes for Assets and Comments.