Users are discussing how to properly rebuild user actions after a bulk import in Discourse, particularly to ensure likes appear in the user profile’s Activity section. Ghan notes that while post actions are imported correctly, user actions (like likes) are missing from the user_actions table. TheDarkWizard questions the removal of the rake task for rebuilding user actions and seeks guidance. sam confirms the rake task was broken and removed. neounix shares a past solution involving custom code for migrating likes, referencing a documented migration process. zogstrip asks if the import:ensure_consistency rake task was run, which Ghan confirms was done but still found user actions not updated. The issue appears to be that the import process does not automatically populate user actions, requiring either custom handling or a working rake task.
Is there a way to rebuild user actions? I have done an import using the bulk importer, and this processes likes by importing them into the post_actions table, but users still show no likes in the Activity->Likes section of the user profile. I think likes need entries in the user_actions table as well. This table only has actions for NEW_TOPIC and REPLY after the import.
Is there maybe a rake task to rebuild user actions that will include relevant post actions or is this something that would need to be imported directly up front?
However in the same topic you suggested people look at the normal importers at the time for guidance. What do you think we should do for the bulk importer?
Likes show up everyone correctly, including in profile stats, posts, PMs, etc. but not in user activity or the about stats page. The two that show up we’re just ones I did after the fact.
I’ll wait to see what @zogstrip can chime in if possible. Would be nice to get likes working completely.
No idea about any existing rake task, but months ago when we imported vB3 to Discourse we wrote custom code to import all the likes from our legacy vB “thank you” plugin.
Some of our custom code for this is documented here:
If I knew then what I know now I would have written a custom rake task back then…
Yes. It seems after that plus some of the regular sidekiq jobs, the post actions were accounted for correctly, but the user action side of that coin was not.