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

XF 1.4 Update legacy likes to preserve anonymity

Gossipy

Active member
#1
We imported a VB board into XF recently. All the VB "reputations" (aka 'karma') were imported into XF as "likes". On the VB board, reputation was anonymous. However now, all the "likes" are associated with the user that gave them, so if a user cares enough they can go back and figure out who gave them negative/positive reputation. We haven't yet activated the "likes" feature on XF for users.

We considered just deleting all the likes to preserve privacy, but that seemed extreme. Then my helper suggested that we can "execute a MySQL query that would go through the XF DB and assign all historical likes to the existing anonymous userID."

We actually have an account that is anonymous; it's used for anonymous posts. Is there an easy SQL query we can execute that would assign ALL previous 'likes' to that user? To make it look like they all came from that anonymous user?

Thanks in advance!! :)
 

Gossipy

Active member
#3
Thank you, @Mouth. We just tried your suggestion and got an error:

Failed to execute SQL : SQL UPDATE xf_liked_content SET like_user_id = 88; failed : Duplicate entry 'post-17145-119' for key 'content_type_id_like_user_id'
 

Mouth

Well-known member
#4
Sorry, cannot help with that. Not sure why it would throw an index error for like_user_id. Perhaps you have duplicate data from import?
 

Mike

XenForo developer
Staff member
#5
A person can only like a post once, so that's expected. There isn't really a way to make likes anonymous. Removing the likes is really the only recommendation I could make (and I would have to do that by not running that step in the importer rather than by editing the DB).
 

Gossipy

Active member
#6
Wow, that stinks. The site's been running on XF for a month or two now (with likes turned off) and so there's really no way to re-import (we'll lose 2+ months of activity if we re-import from VB). I guess we need to figure out a way to just delete all the likes.... :(