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

Importing vB Thanks to xF Likes

#1
OK, got it...
First and foremost, make sure that you preserved post and user ids during the convert from vb to xf.

You can convert vb "Thanks" into xf "Likes" with this query:

insert into xf.xf_liked_content (like_id, content_type, content_id, like_user_id, like_date, content_user_id) select null, 'post', t.postid, t.userid, t.date, p.userid from vb.vb_post_thanks t join vb.vb_post p on (t.postid = p.postid) order by t.id;

(Obviously change the database names and table prefixes to match your situation.)

If you get a key violation error, you have duplicate thanks in the vb database.
Find the problem userid/postid combinations using something like this, and delete them:

select count(*), userid, postid from vb.post_thanks group by userid, postid order by 1;

Afterwards, you need to rebuild the like data. Jake Bunce contributed a script for that here:

http://xenforo.com/community/threads/is-there-a-way-to-rebuild-post-profile-post-like-caches.42384/
Thanks Jake!

I hope you find this conversion helpful.
I have this table
8162f67a42b2488197b1093b72ca65b6.png

If I have table that I import into xf database as thanks table, that mean..

Code:
insert into xf_liked_content (like_id, content_type, content_id, like_user_id, like_date, content_user_id) select null, 'post', postid, userid, dateline, receiverid from thanks where content_id = postid order by userid;
is it allright ?