We are going to migrate from Skype to Mattermost and wish to copy messages for group chats, we managed to parse correctly data from *.db files where Skype stores all the messages and wish to insert that data to PostgreSQL database which will be used by Mattermost.
Main question is how algorithm used to generate Message ID works in Mattermost so we can generate these IDs correctly?
It's a base32 encoded GUID without padding. See the implementation here.
However, if you are importing message history, have you considered using the Bulk Import CLI instead of going directly to the database? This will take care of all the "internal" things like setting IDs and ensuring the relevant table columns are populated correctly.