I have created a sample file to test with one user
data.jsonl :
{“type”: “version”, “version”: 1}
{“type”: “user”, “email”: “—.—@------.com”, “username”: “------”, “password”: “------”, “first_name”: “Sample”, “last_name”: “sample”, “position”: “Engineer-Business Analyst”, “use_markdown_preview”: “True”, “use_formatting”: “True”, “show_unread_section”: “True”, “email_interval”: “immediate”}
commands to be used mentioned in the official docs: Bulk loading data — Mattermost documentation
Inside docker container i am executing below commands:
mmctl import upload data.jsonl --local
mmctl import list available --local
mmctl import process data.jsonl --local
3c0135d2f0df:/myfiles$ mmctl import upload ./data.jsonl --local
Upload session successfully created, ID: 1orcxnxamtbkpkzycgifoun6aw
Import file successfully uploaded, name: u6f96inkjtbxjenojrqa4qnp4r
3c0135d2f0df:/myfiles$ mmctl import list available --local
1orcxnxamtbkpkzycgifoun6aw_data.jsonl
3c0135d2f0df:/myfiles$ mmctl import process 1orcxnxamtbkpkzycgifoun6aw_data.jsonl --local
Import process job successfully created, ID: me5nbrunqinjmq67z1xa5p54ue
3c0135d2f0df:/myfiles$ mmctl import job show me5nbrunqinjmq67z1xa5p54ue --json --local
[
{
“id”: “me5nbrunqinjmq67z1xa5p54ue”,
“type”: “import_process”,
“priority”: 0,
“create_at”: 1678785592922,
“start_at”: 1678785599785,
“last_activity_at”: 1678785599788,
“status”: “error”,
“progress”: -1,
“data”: {
“error”: “Error during job execution. — ImportProcessWorker: Unable to process import: failed to open file., zip: not a valid zip file”,
“import_file”: “1orcxnxamtbkpkzycgifoun6aw_data.jsonl”
}
}
]
Again i have tried with zipping and uploading but facing another error:
3c0135d2f0df:/myfiles$ mmctl import upload ./data.zip --local
3c0135d2f0df:/myfiles$ mmctl import list available --local
8goakyp1b7br7q95usjo3y3ehw_data.zip
3c0135d2f0df:/myfiles$ mmctl import process 8goakyp1b7br7q95usjo3y3ehw_data.zip --local
Import process job successfully created, ID: 3rd33uau3b8bbrrw38u4hbck7c
3c0135d2f0df:/myfiles$ mmctl import job show 3rd33uau3b8bbrrw38u4hbck7c --json --local
[
{
“id”: “3rd33uau3b8bbrrw38u4hbck7c”,
“type”: “import_process”,
“priority”: 0,
“create_at”: 1678786663027,
“start_at”: 1678786664985,
“last_activity_at”: 1678786665024,
“status”: “error”,
“progress”: -1,
“data”: {
“error”: “Unable to update the job.”,
“import_file”: “8goakyp1b7br7q95usjo3y3ehw_data.zip”
}
}
]