Skip to content

[IMPROVE] Slack "corporate-export"-import (groups, direct messages and multi-user-messages)#13942

Closed
niklasdahlheimer wants to merge 24 commits intoRocketChat:developfrom
niklasdahlheimer:slack-coporate-import
Closed

[IMPROVE] Slack "corporate-export"-import (groups, direct messages and multi-user-messages)#13942
niklasdahlheimer wants to merge 24 commits intoRocketChat:developfrom
niklasdahlheimer:slack-coporate-import

Conversation

@niklasdahlheimer
Copy link
Copy Markdown

@niklasdahlheimer niklasdahlheimer commented Mar 28, 2019

Closes #13905

An attempt to include abilities to import all of the data from slack-corporate-exports.
Slack corporate-exports are including private chats, direct messages and multi-user-direct-messages.

The structure of the corporate-export zip-file

├── channels.json
├── subfolder_channel_1 (i.e. "General", "public Information")
│   ├── 2019-12-20.json            
│   ├── 2019-12-21.json
│   └── ... 
├── ... (more subfolders)
├── groups.json
├── subfolder_group_1 (i.e. "secret Group", "Management")
│   ├── 2019-12-20.json            
│   ├── 2019-12-21.json
│   └── ... 
├── ... (more subfolders)
├── mpims.json
├── subfolder_multi_person_chat_1 (i.e. "mpdm-joe-lisa-anna-john", "mpdm-lisa-john-peter")
│   ├── 2019-12-20.json            
│   ├── 2019-12-21.json
│   └── ... 
├── ... (more subfolders)
├── dms.json
├── subfolder_direct_messages_1 (i.e. "D38RUJBCP", "D39AJJG7L")
│   ├── 2019-12-20.json            
│   ├── 2019-12-21.json
│   └── ... 
├── ... (more subfolders)

groups.json and mpims.json looks just like the channels.json.

The structure of the dms.json

[
    {
        "id": "D38RUJBCP",
        "created": 1529308826,
        "members": [
            "U63MAB7U5",
            "U1D4CHJLV"
        ]
    },
    {
        "id": "D39AJJG7L",
        "created": 1527578772,
        "members": [
            "U63MAB7U5",
            "U1GKUUV7H"
        ]
    },...
]

I added parsing of groups.json, which is the equivalent to private channels in Rocket-Chat.

Next steps

  • process mpims.json, which contains the multi-user-direct-messages.
    multi-user-direct-messages are like private channels without a name. Because Rocket-Chat has no feature like this, it needs to be handled as private channels. But the channel name "user1-user2-user3-.." would look silly. Any suggestions on this?

  • direct messages should be parsed also. Two cases:

    • rocketchat_room-document for the private-chat already exists -> add messages to this room id
    • rocketchat_room-document for the private-chat does not exist -> the importer needs to create the rocketchat_room-document for this private chat. How does Rocket-Chat add the rocketchat_room-document for private chats? I only found lib/server/methods/createPrivateGroup.js and lib/server/methods/createChannel.js. Is there an equivalent for private chats?

is now processing groups.json which is the slack-export-file for slack-private-channels.

Also done some preperations to process direct chats later on.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2019

CLA assistant check
All committers have signed the CLA.

@niklasdahlheimer
Copy link
Copy Markdown
Author

niklasdahlheimer commented Apr 1, 2019

I added support for direct message import.

  1. should multi-user-chats be handled the same way as private channels?
  2. Should the user at the import-selection have the possibility to check/uncheck which direct-messages are being imported? Right now the importer imports all direct messages here both users are available.

@geekgonecrazy and @Hudell, any comments about this?
Some feedback on the code would be appreciated due to my lack of experience with javascript.

@niklasdahlheimer niklasdahlheimer changed the title [NEW] Slack "corporate-export"-import (groups, direct messages and multi-user-messages) [IMPROVE] Slack "corporate-export"-import (groups, direct messages and multi-user-messages) Apr 2, 2019
@engelgabriel engelgabriel requested a review from Hudell April 6, 2019 07:20
@engelgabriel engelgabriel added this to the 1.1.0 milestone Apr 6, 2019
@niklasdahlheimer
Copy link
Copy Markdown
Author

I managed to import the data including direct chats and private channels from the slack-corporate-import-zip-file, backuped and restored the mongo-data and use it in the docker production environment of our company right now.
There is still a bug which leads to a fail of the first import, the second import works flawlessly, it can be traced back to a undefined room object in line 381, where I'm not really sure why this happens.

However, some comments of the project maintainers would be appreciated because I still need to know:

  • how we should handle multi-user-chats
  • is there any objection against appending the private channel data to the channel collection (see line 98)
  • what should be the way of improving the feedback for the user? Right now uploading and parsing of the zip file, even if everything is running on localhost, takes really long (~5min for a 10mb-file) and the only feedback the user gets is a connection timeout and a page reload after uploading and preparing has finished. But that not leads back to the import selection, the user has manually navigate to the slack importer again to see the import selection.

@rodrigok rodrigok modified the milestones: 1.1.0, 1.2.0 May 15, 2019
@Hudell
Copy link
Copy Markdown
Contributor

Hudell commented May 22, 2019

Multi user messages can be skipped for now. We are going to implement a similar feature on Rocket.Chat soon, but until then it's ok to skip those conversations.

@geekgonecrazy
Copy link
Copy Markdown
Contributor

Are we planning to get this in a version near? I know there are several people wanting these changes to begin using rocket.chat

@sampaiodiego
Copy link
Copy Markdown
Member

can someone please fix the conflicts? 🤗

@engelgabriel engelgabriel modified the milestones: 1.2.0, 1.3.0 Jul 10, 2019
@niklasdahlheimer
Copy link
Copy Markdown
Author

I think, beside fixing the conflicts, additional testing is needed. I managed to use this version to import the corporate data into Rocket.Chat but had to delete a few files from the import-data-zip-file.
It worked for our company so I didn't spent more time on that.
Unfortunately I can not provide any test-data, because we deleted the uncrypted corporate-import-data due to privacy reasons.

If someone could provide test-data I could bring this feature to a more stable state, so it could be merged into a release.

@pigmonkey
Copy link
Copy Markdown

I have corporate exports and am waiting on this feature before migrating to rocket chat. I cannot share the data, but I can try to spin up a development environment to test this branch on my exports and report the results.

On the subject of multi-party direct messages, I would be happy for them to be imported as user1-user2-user3... private channels -- unless rocket chat's version of that feature is imminent. I would rather not skip that data.

@sampaiodiego sampaiodiego modified the milestones: 1.3.0, 1.4.0 Jul 25, 2019
@sampaiodiego sampaiodiego modified the milestones: 2.0.0, 2.1.0 Sep 6, 2019
@engelgabriel engelgabriel modified the milestones: 2.1.0, 2.2.0 Oct 13, 2019
@rodrigok rodrigok modified the milestones: 2.2.0, 2.3.0 Oct 19, 2019
@AitorCM
Copy link
Copy Markdown

AitorCM commented Nov 26, 2019

So, any news on when this feature is going to be added to RocketChat?

Thanks!

@geekgonecrazy
Copy link
Copy Markdown
Contributor

#16279 - this major refactor might be related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack Import: corporate-export data (direct messages, private channels, etc.) is not imported

10 participants