XF 2.2 Question regarding votes migration from another system (XF2.1)

GPA-R

Active member
Hi,

I am currently using another system to allow people to vote Threads. Migrating to XF2.2 will make this addon redundant as XF 2.2 already has the "Suggestion" forum type which is super cool and needed.

So I already have the thread_id and the user_id from the old voting system.

I wrote a small script which iterates through the old votes and after setting the current user to the user_id of that record it attempts to create a vote.

PHP:
$voteRepo = $app->repository('XF:ContentVote');
$voteRepo->vote("thread",THREAD_ID,"up", null, $user);

I know this may have not been the best or most optimised way to do it but it has successfully converted all the votes and they show up correctly on the front-end of the forum (xf_content_vote table seems fine). Is that OK or am I missing something? (regarding the votes)

Thanks in advance.
 
Last edited:
Top