No users likes right count after migration query


Well-known member
Hi all :)

There aren't any migration add on for vBSEO Likes -> xF Likes, so I've made a script for migrate this data form the table vb_vbseo_likes to xf_liked_content with success.
Now I've the correct data in the xenforo likes table.

However in the xf_user.like_count field all value are zero.
After data migration I've run the rebuild users information without luck.
What procedure I've to follow for updating the users likes information?


Well-known member
I don't know enough about the details of the XenForo schema, but assuming that the total number of records in xf_liked_content equals the like_count number in the xf_user table, this query should do it...

UPDATE xf_user SET like_count = (SELECT COUNT(*) FROM xf_liked_content WHERE content_user_id = user_id)
This comes with the normal warnings... I take no responsibility if it screws something up, do it on a backup first to make sure, etc, etc...