Bulk import problems when importing from slack

I am trying to migrate a slack team to a mattermost team.
I am currently facing multiple problems:

  • slack allow messages up to 40000 characters, mattermost only 4000
    workaround, delete those messages in the “extracted” folder
  • importing the jsonl created by mmetl works on a fresh (my test system) mattermost installation, importing this file into the production system fails since the target users are already in the system
    error msg: “map[error:We could not count the users. — importUser: An account with that email already exists., in valid input: entity: User field: email value: some.email@domain.com
  • how do i clean those old import jobs created by mmctl

Hi mdc_decker and welcome to the Mattermost forums!

Mattermost supports 16383 characters per post, at least on recent versions, but yes, this will definitely require some additional and better handling. Long posts could be split up (threaded, ideally) automatically, f.ex.

The import functionality is designed for initial migration of existing messaging solutions towards Mattermost, there’s not much handling with regards to merging existing user accounts, so the import just refuses to use them. It’s always hard to tell what information should be used then for the accounts if they have matching identifiers (and what is the matching identifier?), so not sure if there’s an easy solution for that.
Can you describe the usecase a bit more? Are you trying to import an additional (new?) team into your already existing mattermost installation where some of the team members are also already available in this Mattermost setup? I think there should be a way around this by removing the user creation command for the overlapping users and replacing their posts with the real Mattermost user IDs, the import should work just fine then, but it will require a bit of manual tuning of the export file.

There’s no way to clean the import jobs right now using mmctl or the API, sorry.

turns out, i just need to adjust the username in the jsonl to to match up with the one already in mattermost. then its not failing on import

Yes, but you need to take care, the users will still be “created” and will overwrite existing profiledata, so if f.ex. there’s a user called jdoe in slack and you also have a jdoe in your Mattermost installation, the import data will overwrite existing attributes.

Let’s say the user account in Mattermost looks like this:

firstname: Jane
lastname: Doe
username: jdoe
email: jdoe@whatever.com

And the to-be-imported account from slack looks like this:

firstname: 
lastname: 
username: jdoe
email: jdoe@whatever.com

The import might remove the firstname and ’ lastname’ attributes of the already existing username.
At least I recall having heard reports about that.