XF 1.4 manually import dbtech thanks

Jake Bunce

Well-known 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 "dbtech thanks" addon in vB and you want to manually import those "thanks" as "likes" then run this query:

Rich (BB code):
INSERT INTO XFdbname.`xf_liked_content` (content_type, content_id, like_user_id, like_date, content_user_id)
	SELECT 'post', dbt.contentid, dbt.userid, dbt.dateline, post.userid
        FROM vBdbname.`dbtech_thanks_entry` AS dbt
        LEFT JOIN vBdbname.`post` AS post ON (post.postid = dbt.contentid)
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
 
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 "dbtech thanks" addon in vB and you want to manually import those "thanks" as "likes" then run this query:

Rich (BB code):
INSERT INTO XFdbname.`xf_liked_content` (content_type, content_id, like_user_id, like_date, content_user_id)
    SELECT 'post', dbt.contentid, dbt.userid, dbt.dateline, post.userid
        FROM vBdbname.`dbtech_thanks_entry` AS dbt
        LEFT JOIN vBdbname.`post` AS post ON (post.postid = dbt.contentid)
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
The old and new forums are on different databases. The same server and IP, just different databases. I wanted to start a complete fresh this time. The old forum had been on that DB for around 8 years and with various customisations over the years it was very messy.
 
1. Keyword not recognized (near "KEY)
2. Unexpected Token (near "=")


on query:
Code:
INSERT INTO XFDB.'xf_liked_content' (content_type, content_id, like_user_id, like_date, content_user_id)
SELECT 'post', dbt.contentid, dbt.userid, dbt.dateline, post.userid
        FROM VBDB.'dbtech_thanks_entry' AS dbt
        LEFT JOIN VBDB.'post' AS post ON (post.postid = dbt.contentid)
ON DUPLICATE KEY UPDATE content_id = VALUES(content_id);

There's any angel can help me? :3
 
has anything changed with this recently....i tried running the query....pretty sure i got all the prefixes and everything in properly...tried a couple ways to be sure but the best result was this error....running latest xen1.5 btw...hope thats not why......source vb4.2.5

ideas?

MySQL said: Documentation
#1048 - Column 'content_user_id' cannot be null
 
Last edited:
:unsure:hmm not sure what that would be...it is a live database, havent had any issues there, can see all the dbtech likes everywhere...peeking into the content_user_id i can see values....some are zeros, but dont really understand why they wont import or how to resolve it
 
Hi @Jake Bunce
does this query is good also for XF 2?
For XenForo (likes) it is the following:
Code:
INSERT INTO XF.`xf_reaction_content` (reaction_id, content_type, content_id, reaction_user_id, reaction_date, content_user_id, is_counted)
    SELECT 1, 'post', dbt.contentid, dbt.userid, dbt.dateline, dbt.userid, 1
        FROM XF.`dbtech_thanks_entry` AS dbt WHERE `varname` LIKE 'likes'
        LEFT JOIN XF.`post` AS post ON (post.postid = dbt.contentid)
ON DUPLICATE KEY UPDATE
        content_id = VALUES(content_id);
 
Great many thanks Ivancas, I have just solved times ago, but sure can be more helpful for many other users are moving from Vb because to import the Likes is really important
 
For XenForo (likes) it is the following:
Code:
INSERT INTO XF.`xf_reaction_content` (reaction_id, content_type, content_id, reaction_user_id, reaction_date, content_user_id, is_counted)
    SELECT 1, 'post', dbt.contentid, dbt.userid, dbt.dateline, dbt.userid, 1
        FROM XF.`dbtech_thanks_entry` AS dbt WHERE `varname` LIKE 'likes'
        LEFT JOIN XF.`post` AS post ON (post.postid = dbt.contentid)
ON DUPLICATE KEY UPDATE
        content_id = VALUES(content_id);
I can't edit the query so here is the right one:

SQL:
INSERT INTO XFDB.`xf_reaction_content` (reaction_id, content_type, content_id, reaction_user_id, reaction_date, content_user_id, is_counted)
    SELECT 7, 'post', dbt.contentid, dbt.userid, dbt.dateline, dbt.receiveduserid, 1
        FROM VBDB.`dbtech_thanks_entry` AS dbt WHERE `varname` LIKE 'thanks'
ON DUPLICATE KEY UPDATE
        content_id = VALUES(content_id);

7 is the id of the reaction in XenForo you want to import to
 
Back
Top Bottom