Import from Slack - existing users

I’m trying to import a whole Slack team into Mattermost, following the exact steps in Migration guide — Mattermost documentation.

I’m not able to do it due to an error with existing users. It seems there are conflicts with already registered emails.

What I’ve tried and what I’ve got

  1. Importing the file with the mmctl command. This gives the following error:
$ sudo docker exec -it -w /mattermost/config mattermost-mattermost-1 mmctl --local import upload ./import1/
Upload session successfully created, ID: 8z59bc1gbbg7zkbii6hhgy5gfc

$ sudo docker exec -it -w /mattermost/config mattermost-mattermost-1 mmctl --local import list available

$ sudo docker exec -it -w /mattermost/config mattermost-mattermost-1 mmctl --local import process
Import process job successfully created, ID: d6ue8e3iu7nnzfec9kiggjbk6e

$sudo docker exec -it -w /mattermost/config mattermost-mattermost-1 mmctl --local import job show d6ue8e3iu7nnzfec9kiggjbk6e
  ID: d6ue8e3iu7nnzfec9kiggjbk6e
  Status: error
  Created: 2023-07-03 18:55:46 +0000 UTC
  Started: 2023-07-03 18:55:52 +0000 UTC
  Data: map[error:Error during job execution. — importUser: An account with that email already exists., invalid input: entity: User field: email value: line_number:105]

(the email is just a regular one, I just replaced it here with ‘xxxxxxxxx’ for privacy)

  1. I manually unzip and remove the emails in file mattermost_import.jsonl, letting all the fields blank. I zip it back and repeat the same steps and what I get is:
$ sudo docker exec -it -w /mattermost/config mattermost-mattermost-1 mmctl --local import job show pkc5rs6w6ir4zg5ozdc4tzayxw
  ID: pkc5rs6w6ir4zg5ozdc4tzayxw
  Status: error
  Created: 2023-07-04 08:53:04 +0000 UTC
  Started: 2023-07-04 08:53:17 +0000 UTC
  Data: map[error:Error during job execution. — BulkImport: User email has an invalid length. line_number:102
  1. I completely remove all the email fields and repeat it again.
sudo docker exec -it -w /mattermost/config mattermost-mattermost-1 mmctl --local import job show 9wt8wfezxpfmpby6375ts13epy
  ID: 9wt8wfezxpfmpby6375ts13epy
  Status: error
  Created: 2023-07-04 09:47:07 +0000 UTC
  Started: 2023-07-04 09:47:18 +0000 UTC
  Data: map[error:Error during job execution. — BulkImport: Missing required user property: email. line_number:102]

I’m using Mattermost 7.9 deployed over Docker with nginx, following Install Mattermost via Docker — Mattermost documentation

Did somebody do this sucessfully? How should it be done?

Thanks in advance!

Hi Germán and welcome to the Mattermost forums!

The e-mail attribute is mandatory for Mattermost users, so removing them from the import file will lead to the errors you’re seeing in step 2 and 3. Are you trying to merge platforms here? So is there already a local user base and posts in the Mattermost server and you try to import slack data additionally to it? I’m not sure if this is supported. What would you expect to happen when there’s a local user X and one in the slack export? Should these users messages be merged? What about channels with the same names? Should they also be merged or should new ones be created then?

Hi Alexander, thanks for your answer!

Some users already registered themselves in Mattermost with the same email they had in Slack. In any case, what I’m trying is to import all their posts into a “empty” new team I just created. So, answering to your questions, I don’t expect channels to be merged, since there are none in the new Mattermost team I created to import everything into.

I hoped the import process to automatically match them both, but maybe this is not what it is meant to do.

Just for you to know, I previously tried to do all the above process without having created a team with the name of the export, and what I got was the following error (so only then I created the team and got the errors I explained in my first post):

$ sudo docker exec -it -w /mattermost/config mattermost-mattermost-1 mmctl --local import job show 9oj1auertjgn8kuciazgzo936e
  ID: 9oj1auertjgn8kuciazgzo936e
  Status: error
  Created: 2023-07-06 08:13:57 +0000 UTC
  Started: 2023-07-06 08:14:06 +0000 UTC
  Data: map[error:Error during job execution. — BulkImport: Error importing channel. Team with name "vizteam" could not be found., resource: Team id: name=vizteam line_number:2]

All in all, I suspect I’m really missing something. How should I do it instead? Should I kick out all the registered users, then perform the import and invite them again to Mattermost?

We’re also facing the same scenario [edit: we’re using Kubernetes instead of Docker, but that is unlikely to make a difference], and have taken the same steps and gotten the same results as @HerManNav. We have an older Slack corporate export that predates our use of Mattermost, and we wanted to import that data. We specifically avoided creating identically named teams in Mattermost (in accordance with the documentation), and created a new team workspace with the same name as our old Slack workspace.

From the documentation:

We recommend you create a new team in Mattermost to hold the imported Slack data. You can import this into an existing team, but ensure there are no channel name collisions. Also, make sure that all users in Mattermost have the same username as in Slack, otherwise the import will fail.

It’s not clear from the documentation at all that importing Slack data to an in-use Mattermost instance is not supported when you’re specifically importing into a “blank”/“empty” team. This does seem like a bug.

@HerManNav Were you able to find a resolution for this issue? If so, would you be able or willing to share?

Hi Jeffrey, I didn’t.

I talked to the users and they told me that they were still using Slack and that they hadn’t started an actual transition to Mattermost yet. So, as they only had a few chats in MM, I tried one last thing:

  1. I deleted all their accounts in MM (and therefore all their messages were lost)
  2. I created a new “empty” team, with the name of the Slack export, just as I explained in my previous post here
  3. And I repeated the steps in my first post

This didn’t work either. So I stopped trying and just assumed that the mmctl import utility is not mature enough.

Thanks to you both in any case.