Skip to content

rifflearning/mattermost-import-csv

 
 

Repository files navigation

Mattermost CSV to Bulk Import JSON Converter

Install

  1. Install Node.js Version 18.15.0 LTS or greater

  2. Clone this repo
    $ git clone https://github.com/Brightscout/mattermost-import-csv

  3. Install dependencies
    $ cd mattermost-import-csv
    $ npm install or $ yarn install

  4. Run tests
    $ npm test

Configure

Modify the values in context/config.js for the source, target

Data to be imported must be valid

Some contraints to be aware of:

  • username must be all lowercase (no capital letters)
  • email must be all lowercase (no capital letters) [I think]

Export

  1. Execute the converter
    $ npm start

  2. Inspect the output file, target.json, or whatever you set as the target filename. Ensure the results are as expected.

Import

  1. Run the Mattermost bulk loading command as explained here

RiffEdu bulk loading command procedure

  • get the import.json (or whatever you name it) file to the RiffEdu instance in the ~/tmp directory
  • find the container id of the edu-stk_edu-mm container (e.g. 78119bd4328b)
docker cp tmp/import.json 78119bd4328b:/home/mmuser/
docker exec -it 78119bd4328b bash
cd riffedu
bin/mattermost import bulk ~/import.json --validate
bin/mattermost import bulk ~/import.json --apply
exit

Made with ♥ by Brightscout

About

A CSV to Bulk Import JSON Converter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%