• 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

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:

Thanks Jake!

I hope you find this conversion helpful.
I have this table

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

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 ?