Lombiq/HipChat-to-Microsoft-Teams-Migration-Utility

Support importing chats

Opened this issue · 4 comments

I.e. import the users folder in the HipChat export into Teams chats. Possibly also be able to import selected rooms into multi-person chats as well, since semantically they're more like chats (just were created as private rooms in HipChat due to the lack of better options).

Creating chats doesn't seem to be possible via the Graph API however: chat threads can be created but not messages for private chats. There is no create method for chat messages, so no way to create them apart from creating them as part of a new chat thread.

In the interim, what about a workaround? I'm thinking maybe create a team for each user (that we can then assign as private to that user), then create a channel for each 1:1 chat that user had. This would at least allow for searching of all the old chat data. The other advantage to this is it allows each user to have a private team, which is necessary for private notes to yourself (a feature our users extensively used in HipChat)

Example:

Team (User A 1:1 chats)
-General Channel (User A User A)
-Channel 1 (User A User B)
-Channel 2 (User A User C)
-Channel 3 (User A User D)

I'm happy to help test this if you'd like as we have extensive 1:1 chat history we'd really like to get into Teams.

This would be a workaround, yes. We didn't implement support for this because in our case creating teams for each two-user chat wasn't a suitable workaround, nor does private chat contain crucial information that we absolutely want to keep easily browsable (culturally we use rooms for all but really private conversations).

However I looked into this and at least processing private chats from the HipChat export package is not too complicated since it has the same structure as room chats. It gets a little more tricky with creating these quasi-channels (or even quasi-teams).

Since we've already moved to Teams and using it, and as mentioned there is no real need for us specifically we don't have much motivation to work on this. Would you be able to contribute the feature? I can give you pointers.

Yes, we could most likely contribute if you wouldn't mind shooting over your ideas on how to get started. Frankly, we don't necessarily need this information inside teams, just need a way to search the years and years of history we have in HipChat somehow. Would have been great if Atlassian provided a way to import the hipchat data into a static searchable DB.

Almost the whole import logic is in this class.

Here on ln 42 you can see how the JSON for rooms is deserialized. You may need to do the same for users.json (speaking about the contents of the HipChat export package here; model classes for HipChat data are here), or you can just iterate through the chat folders under the users folder of the package.

Then you need to create channels and import messages, which could happen as it happens already for normal channels in ChannelsImporter. The chat history in the users subfolders are represented as PrivateUserMessage objects, but it's almost the same as UserMessage, so just little additions needed there.