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

XF 1.1 Post Thank You Hack into likes

Discussion in 'Installation, Upgrade, and Import Support' started by aculate, Nov 23, 2011.

  1. aculate

    aculate Well-Known Member

    I just bought xenForo 1.1 and im testing the import function... I'm importing from vb3.8 to 1.1. So far, everything went very smooth

    My question is how do import the Post Thank You Hack into likes after the import ?

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This one?


    I haven't ever used that addon, but I just looked at the code and it stores all "thank yous" in a table called post_thanks.

    Since the importer already imports reputation as likes, I would do a cross-table insert query on the vBulletin database to create reputation records from the "thank you" records. Then the importer should pick that up.

    I can't test it because I don't have access to your data, but I think this query will work for you:

    INSERT INTO reputation (postid, userid, reputation, whoadded, reason, dateline)
    	SELECT pt.postid, p.userid, 1, pt.userid, '', pt.date
    	FROM post_thanks AS pt
    	LEFT JOIN post AS p ON (p.postid = pt.postid);
    Run this query on the vBulletin database before the import.

    Because this query changes the data for the purpose of an import, you don't want to run this on a live database or one that you intend to keep using after the import.
  3. high1976

    high1976 Active Member

  4. simunaqv

    simunaqv Well-Known Member

    You have to install this add-on before you actually start the import. After the installation of this add-on an extra button appears in the import controls which triggers the import of post thanks into likes. You can safely uninstall this add-on after importing. We successfully used this add-on when we migrated our forum but this took extremely long i.e. almost 12 hours for about 750,000 posts. Using direct sql queries might be faster but we did not try it.
    aculate likes this.
  5. Triops

    Triops Active Member

    Although this thread is rather old, it works fine for vB4.2.1 with the core vB4-importer in XF 1.2.0. Thank you so much, Jake!

    BTW: I've emptyed the table "reputation" in vB4 before running that query, because I never used the reputation system on vB - and there was only trial and old rubbish inside. Furthermore one should know, that the amount of likes imported into XF is much less than the amount of post_thanks/reputation in the vB tables - depending on the number of posts you delete in your forums. I struggled shortly because of that, missing 25k of likes, before I had the idea, that likes from deleted posts of course won't be imported.
    Jake Bunce likes this.

Share This Page