Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack database migration #332

Closed
9 of 12 tasks
IwishIcanFLighT opened this issue Jul 23, 2015 · 127 comments
Closed
9 of 12 tasks

Slack database migration #332

IwishIcanFLighT opened this issue Jul 23, 2015 · 127 comments
Assignees

Comments

@IwishIcanFLighT
Copy link

Hi, I just discovered RocketChat and I already love it! Keep it up!

As RocketChat claims itself as a Slack-like app, I think it would be great to let the admins to migrate theirs own Slack database (channels, user infos, etc) via the Slack export tool. The export is a bunch of JSON file ready to be used.

This would encourage people to use RocketChat instead of Slack, even if they've been using Slack before.

Thanks !

Items Left to Be Done:

  • Message to a channel when that channel is archived
  • File uploads/attachments
  • Emails for invites (or something) to be sent out after the import is finished and new users were imported which aren't deleted in slack.
  • Lots of testing
  • Messages from bots (bot_message)
  • Messages about channel renaming (channel_name)
  • Messages about setting a channel's topic (channel_topic)
  • Messages about messages being pinned (pinned_item)
  • Messages about setting a channel's purpose (channel_purpose)
  • Messages about a channel being archived (channel_archive)

** Not Importing Right Now **

  • Messages about file comments (file_comment)
  • Messages about integrations being added to channels (bot_add)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@sampaiodiego
Copy link
Member

we are glad to hear that you loved our app :D

this migration makes sense but we haven't thought about it before.

maybe when we get closer to 1.0 we should do it

@IwishIcanFLighT
Copy link
Author

Awesome, thanks ! :D

@guarilha
Copy link

I guess this should be available with the slack-like API (#202) . Maybe it could be added to the v1.1 milestone as well.

@rodrigok rodrigok modified the milestone: Next Aug 15, 2015
@Angarsk8
Copy link

Angarsk8 commented Oct 7, 2015

This would be the best thing ever! I would really like to migrate all the information from my Slack team to Rocket.Chat

@sampaiodiego
Copy link
Member

btw, @graywolf336 was working on importing slack data, but I dont how it is going.

@graywolf336
Copy link
Contributor

Yes, currently working on and off with @geekgonecrazy to get the import framework complete and then finish the slack import.

@IwishIcanFLighT
Copy link
Author

That's great news! I can't wait to test it! 😄

@graywolf336
Copy link
Contributor

I've made some good progress, but need opinions. Currently when you upload the exported file (zip) it returns back the users and channels you had in Slack. It contains the deleted users along with the archived channels. My test export has 22 users and 28 channels, a small amount compared to other organizations I've heard about. I want to present a list of users and a list of channels then allow the person doing the importing to select which ones they want, but, and I am asking for opinions, I am unsure how to efficiently do this if the import data has a ton of users and channels. Should it just be a checklist with a Select All up top? Because I also want to enable it so that if there are any current users or channels in Rocket.Chat which align to the Slack data then it suggests that and you can decline or accept to merge the two.

@geekgonecrazy
Copy link
Contributor

@RocketChat/owners thoughts / feedback on this ? ^

@sampaiodiego
Copy link
Member

Oh well, it really could be a pain when you have so much things to import.
my suggestion is to create a button "import all", that does what it says =P

did you have import data to a temp collection after uploading the zip file? if so, it could be simple to create a page showing fewer results per page and setting a flag on that row on db..

@graywolf336
Copy link
Contributor

A nice big button at the top that says "Just Import it All!" 😝

No they're not in a temporary collection or anything, just in memory but could easily be converted over or could be paged with how they're stored for now (nothing is final, just the beginnings).

@liamdawson
Copy link
Contributor

@graywolf336: I'd love to get my team trialling Rocket.Chat for business usage, is there any way I can give a hand?

@graywolf336
Copy link
Contributor

@liamdawson: Message me on Rocket.Chat demo server and we can discuss details 😄

@graywolf336
Copy link
Contributor

Just a status update, I've got channels, users, and messages importing. Currently working on the special message types and importing files.

2015-10-23_14-03-05

@geekgonecrazy
Copy link
Contributor

👍 this is awesome!

@engelgabriel
Copy link
Member

@graywolf336 you are awesome!!!!

@graywolf336
Copy link
Contributor

Things left to do:

  • File uploads/attachments
  • Message to a channel when that channel is archived
  • File comments - this I am unsure how to handle, suggestions are welcomed.
  • Cleaning up the slack message to rocket message, currently a bunch of 'replace' methods.
  • Lots of testing
  • Anything I missed
  • Emails for invites (or something) to be sent out after the import is finished and new users were imported which aren't deleted in slack.

This sounds strange, but I am looking for someone with a rather large Slack export so that I can test with and verify it doesn't crash majorly when the exported zip file is larger than 1,627KB.

@engelgabriel
Copy link
Member

@graywolf336 I've added your list to the issue description as a checklist.

@graywolf336
Copy link
Contributor

@engelgabriel Sounds good, I'll let you know when I complete the items since I can't check them off myself. If you happen to come across a community or someone interested, have them contact me so we can test it with other Slack exports besides mine...especially larger sized ones.

@jimlawton
Copy link

@graywolf336 I've got a large-ish Slack export (about 8.5MB) that I could try out a Rocket.Chat import on if you're interested.

@graywolf336
Copy link
Contributor

graywolf336 commented Nov 12, 2015

@jimlawton I am extremely interested in that, as that's a great deal larger than mine. There's two options we can test with.

First one is you clone the project where the code is and run it there then let me know if you have any issues.

Second one would be to send me the file so I can test and have a first hands experience with the import along with any errors that occur so I can fix them.

@jimlawton
Copy link

jimlawton commented Nov 13, 2015

Unfortunately, I can't share the archive. I'm building the import-framework
branch at the moment, and I'll try it out and let you know how I get on.

@graywolf336
Copy link
Contributor

@jimlawton Did you manage to get it going? Any errors? Suggestions?

@jimlawton
Copy link

I'm afraid I haven't had much time today. I cloned it and built it and ran
it up but then realised that I had cloned the original repo and not the one
you pointed at. Doh. I will give it a shot over the weekend and get back to
you.

On 13 November 2015 at 14:23, Bradley Hilton [email protected]
wrote:

@jimlawton https://github.com/jimlawton Did you manage to get it going?
Any errors? Suggestions?


Reply to this email directly or view it on GitHub
#332 (comment)
.

@graywolf336
Copy link
Contributor

Not quite. Instead of letting Rocket.Chat create a new id for each message's record, we set the id to Slack's. Does that make more sense?

@patcon
Copy link
Contributor

patcon commented Feb 17, 2016

Oh yes, of course! Sounds good. Thanks :)

@graywolf336
Copy link
Contributor

@patcon Shouldn't be too hard of a change to make, feel free to make a pull request for it and I will take a look at it! :)

@patcon
Copy link
Contributor

patcon commented Feb 17, 2016

Ah wait. Seems there's not exactly an uid, but a timestamp (ts) field. We could treat it as a unique field, but this might not always be the case, right?

@engelgabriel
Copy link
Member

Maybe just append a S to the front of the Slack Id so it will be always evaluated as STRING when using it.

@graywolf336
Copy link
Contributor

@patcon Yes, that is correct. The ts field is a timestamp plus period plus a number which represents the message id in that channel. So, yeah like @engelgabriel said prepend a S on the front just to make sure it gets treated as a string and doesn't get parsed into a number.

@mrplow
Copy link

mrplow commented Feb 17, 2016

@engelgabriel wait what?! Full history or just messages not hit by the 10k message limit? Isn't that only for corporate accounts and not the free version?

Bare in mind you can export/capture private channels from slack.

@patcon
Copy link
Contributor

patcon commented Feb 17, 2016

OK, but the message id doesn't seem to be per-channel, but per-channel-month or something. So for our #general chat, it seems to reset every month on the 24th for January... EDIT: And the 28th for Dec. seems inconsistent. Curious whether it's the same in between exports. I'll check

@graywolf336
Copy link
Contributor

@patcon Should still be unique due to the timestamp if you do id: 'S1439339289.000003' where 1439339289.000003 was the time stamp.

@mrplow I believe he meant you can't export private channels or direct messages from Slack. The only thing which gets exported in Slack is the public channels and messages, including those beyond the 10K limit on free accounts.

@patcon
Copy link
Contributor

patcon commented Feb 17, 2016

@graywolf336 sorry, you're right. And I've confirmed that there don't seem to be any wonky changes in those id's between exports

@graywolf336
Copy link
Contributor

@patcon Awesome! 👍 This will be a neat change to have and very welcomed!

@engelgabriel
Copy link
Member

From https://slack.com/privacy-policy

Message Exports
Administrators of all teams, both free and premium, can export their team’s messages and files that are shared in channels. Message history for private channels and direct messages is not included in this.
Only owners for teams who have signed up for the appropriate level of Slack service and have enabled Compliance Exports can export their team’s private channel's messages, private channel's shared files and direct messages. Compliance Exports may include message edit and deletion history.

@graywolf336
Copy link
Contributor

@engelgabriel Ah so that's changed since I last saw. If we can get our hands on an export which contains the private groups and direct messages, that would be great. But as it stands right now, the exports which contain those aren't supported and might even fail or would ignore the private groups and private messages.

@mrplow
Copy link

mrplow commented Feb 17, 2016

Looks like you can use the slack api to pull json data of private history

https://api.slack.com/methods/groups.history/test

@graywolf336
Copy link
Contributor

Correct and that's totally possible but right now the importer doesn't use
any of those and instead uses the zip file. We would be more than happy to
accept a pull request which allows the usage of that!

On Wed, Feb 17, 2016, 2:52 PM mrplow [email protected] wrote:

Looks like you can use the slack api to pull json data of private history

https://api.slack.com/methods/groups.history/test


Reply to this email directly or view it on GitHub
#332 (comment)
.

@patcon
Copy link
Contributor

patcon commented Feb 17, 2016

Hey @graywolf336, can you think of any reason why this sanitization couldn't go into @convertSlackMessageToRocketChat:

https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-importer-slack/server/SlackImporter.coffee#L216

@graywolf336
Copy link
Contributor

@patcon The only reason I see that being an issue is that convertSlackMessageToRocketChat doesn't return anything when the item passed into isn't truthful. So, you would probably need to add an else statement to convertSlackMessageToRocketChat to return an empty string. Once that happens, then I'd say go for it.

@Xqua
Copy link

Xqua commented May 17, 2016

FYI should warn about memory overload ! just crashed my server trying to import the files.

@engelgabriel
Copy link
Member

What is the spec of your server?

@Xqua
Copy link

Xqua commented May 18, 2016

1Gb RAM, I guess that is bearly enought for rocketchat to start with.
Import took about 500 Mb of RAM more and crashed it. It's ok though I just added 1 more Gb to it.

@graywolf336
Copy link
Contributor

graywolf336 commented May 18, 2016

How big is your slack export?

@Xqua
Copy link

Xqua commented May 18, 2016

100mb about

@skiseiju
Copy link

Dear
If i can export private room, can it import by a son file like attach
1462349047955-mkt-startup-news-slack-history.json.zip
?

@graywolf336
Copy link
Contributor

@skiseiju No, the Slack importer expects the entire Slack export and currently doesn't support private groups as we haven't had any export with private groups.

@doctorwho92
Copy link

doctorwho92 commented Aug 3, 2016

@graywolf336 I'm trying to import a Slack data export zip and it says "the file uploaded isn't a valid slack export file."

@engelgabriel
Copy link
Member

@doctorwho92 can you please open this as another issue, because this issue is already closed and we will forget to track it.

@engelgabriel engelgabriel modified the milestone: Important Dec 6, 2016
Peym4n added a commit to redlink-gmbh/Rocket.Chat that referenced this issue May 14, 2018
* Smarti-203: Flag widget messages
* Smarti-203: Rename widget message flag to skipAnalysis
* Smarti-52: Add support for edited messages
* redlink-gmbh/smarti#221: Set room topic as support area for conversation
* Revert "redlink-gmbh/smarti#221: Set room topic as support area for conversation"
 This reverts commit c7966a3.
* redlink-gmbh/smarti#225: Fix widget footer styling
* redlink-gmbh/smarti#220: Improve error handling
* SmartiWidgetBackend: Improve error handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests