• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

No users likes right count after migration query

giorgino

Well-known member
#1
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?
 

digitalpoint

Well-known member
#2
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...

Code:
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...