Importing from Vanilla, need assistance for Likes

Hello Discourse Community!

I’ve been playing around with migrating from Vanilla. I imported via the Vanilla import script and everything went fine so far.

Now I’m stuck and ask for your input.

I’ve been using the “Kudos” plugin in Vanilla to provide users the ability to like posts. Now I want to migrate these likes to discourse too. I found the following useful information:

I was already able to convert the data from MySQL and make it compatible with the “post_actions” table in PostgreSQL, matching the post IDs and user IDs to the new IDs and so on.

My problem:

  • I inserted one line into the post_actions table in the discourse database
  • The like would not show up when viewing the corresponding post in discourse
  • I then liked the post within discourse and the (now) two likes showed up
    • When checking the coresponding user I importet the like for, no likes where shown in the user profile
    • I don’t want to manually like every post so likes show up when viewing the post

My Questions:

  • Is there a recommended way to import likes from another source?
  • Is there a way to tell discourse to go through the post_actions table and do all the necessary actions?
    • Update posts
    • Update users
    • Update history or whatever else may be needed

Thanks if you followed so far and thank you in advance for your comment. If any furher information is needed please go ahead and ask straight away!

Search the existing importers for ‘like’ and see if there are examples.

5 Likes

Thank you very much for the quick response!
I found a whole function in /var/www/discourse/script/import_scripts/lithium.rb. I will try adapting that to my needs.

4 Likes