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

XF 1.4 manually import post thanks

Discussion in 'Installation, Upgrade, and Import Support' started by Jake Bunce, Nov 9, 2014.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I am posting this here for reference.

    This assumes you enabled the option during the import to preserve the source ids.

    If you use the "post thanks" addon in vB and you want to manually import those "thanks" as "likes" then run this query:

    Code:
    INSERT INTO XFdbname.`xf_liked_content` (content_type, content_id, like_user_id, like_date, content_user_id)
    	SELECT 'post', vl.postid, vl.userid, vl.date, post.userid
            FROM vBdbname.`post_thanks` AS vl
            LEFT JOIN vBdbname.`post` AS post ON (post.postid = vl.postid)
    ON DUPLICATE KEY UPDATE
            content_id = VALUES(content_id);
    
    Then run this script:

    https://xenforo.com/community/threa...t-profile-post-like-caches.42384/#post-457352
     
    TheLaw, Gatses, Eagle and 4 others like this.
  2. sps-forum

    sps-forum New Member

    got a message by running the query in mysql (xf db):
    Code:
    #1142 - SELECT command denied to user '..'@'..' for table 'post_thanks'
    maybe I dont have the permission to run this query..

    what can I do?
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Change the permissions for the database user.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The query does span two databases. So your MySQL user needs access to both the vB and XF databases. Otherwise you can copy the post_thanks table to your XF database to avoid having to query two different databases at once.
     
  5. sps-forum

    sps-forum New Member

    i copied the table post_thanks to my XF database,

    got a new message by running the query:

    Code:
    #1146 - Table 'd001cfc10.post' doesn't exist
    
    i run this query without db-names:

    Code:
    INSERT INTO `xf_liked_content` (content_type, content_id, like_user_id, like_date, content_user_id)
       SELECT 'post', vl.postid, vl.userid, vl.date, post.userid
      FROM `post_thanks` AS vl
      LEFT JOIN `post` AS post ON (post.postid = vl.postid)
    ON DUPLICATE KEY UPDATE
      content_id = VALUES(content_id);
    
     
    Last edited: Feb 2, 2015
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Oh you need to copy the 'post' table too...
     
  7. sps-forum

    sps-forum New Member

    Thank you! :)

    worked ..
     
  8. Kintaro

    Kintaro Well-Known Member

  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page