Can't import file with mmctl

I’m migrating my MM instance and I’m getting an error with mmctl not able to open the file.

  • mm is an alias for mmctl etc. command and works (I can interact with the existing MM)
  • Zip and unzip are installed on my Rockylinux 8 server
  • MM 11 runs on Docker
  • the import file has the same size as when it was exported on the first server
  • I exported with mmctl
  • owner and permissions seem ok
  • I followed official documentation from here mmctl command line tool - Mattermost documentation
  • My MM works fine
  • the zip file is not corrupted, tested with unzip -t myfile.zip
    No errors detected in compressed data of 6cf85fx7nbnwjqresq3mamwbbr_export.zip.

[0][root@data]# ls -l
total 67908
-rwxrwxrwx 1 2000 2000 69519335 Feb 6 16:26 6cf85fx7nbnwjqresq3mamwbbr_export.zip
drwxrwxrwx 2 2000 2000 4096 Jan 23 11:09 brand
drwxrwxrwx 2 2000 2000 4096 Jan 23 09:44 plugins
drwxrwxrwx 7 2000 2000 4096 Feb 5 09:44 users
[0][root@data]# mm import validate 6cf85fx7nbnwjqresq3mamwbbr_export.zip
Validation complete
Error: error opening the import file “6cf85fx7nbnwjqresq3mamwbbr_export.zip”: open 6cf85fx7nbnwjqresq3mamwbbr_export.zip: no such file or directory

Any idea about what is happening?

What happens if you run the mmctl command directly, and don’t use the alias?
Can you give the output of which mm?

You say it’s an alias for more than just mmctl, and if it’s doing anything that might change the cwd then that would explain your problem.

I ran the same operation using the whole command:

docker exec -ti docker-mattermost-1 mmctl import validate 6cf85fx7nbnwjqresq3mamwbbr_export.zip --local

which outputs the same error:

Validation complete
Error: error opening the import file “6cf85fx7nbnwjqresq3mamwbbr_export.zip”: open 6cf85fx7nbnwjqresq3mamwbbr_export.zip: no such file or directory

The result of

which mm

gives me a correct output:

alias mm=‘docker exec -ti docker-mattermost-1 mmctl --local’
/usr/bin/docker

meaning that it’s using mm included in the docker container.

for example:
mm version or the whole command point to the right docker container. So I think the cli is ok but there’s an issue whether with the .zip file itself or the handling of file with the cli.

[0][root@data]# docker exec -ti docker-mattermost-1 mmctl version --local

mmctl:
Version:	11.3.0
BuiltDate:	dev
CommitDate:	2026-01-05T08:02:00Z
GitCommit:	d27a2195068ddfa3ce17cf470f9739e4edb94b83
GitTreeState:	dirty
GoVersion:	go1.24.6
Compiler:	gc
Platform:	amd64/linux

what do you think?

It looks to me like you’re running a command inside the docker container to try and import a file that is outside the docker container.

If your instance is reachable via HTTP(S), install mmctl on the outer host and run the command from there.

Alternatives:

  • copy the file inside the container first
  • move the file to a directory that is mounted inside the container, and pass the internal path to mmctl

thanks @mpounsett for your Time and attention. As I’m new to docker I might have missed an important point.
I’m running mmctl from this folder:
/var/www/vhosts/domain.com/httpdocs/docker/volumes/app/mattermost/data

In my config.json file, my volumes are mapped this way
/var/www/vhosts/domain.com/httpdocs/docker/volumes/app/mattermost/data >> /mattermost/data

and other folders are declared according to the same logic:

I’ve tried to export and the export went to /mattermost/data/export

Then I tried to validate the exported file and got the same error
[0][root@export]# docker exec -ti docker-mattermost-1 mmctl import validate cn3nx158ytnkuq8x6tbet9meee_export.zip --local
Validation complete
Error: error opening the import file “cn3nx158ytnkuq8x6tbet9meee_export.zip”: open cn3nx158ytnkuq8x6tbet9meee_export.zip: no such file or directory
[1][root@export]# ls
cn3nx158ytnkuq8x6tbet9meee_export.zip

I’ve checked the permissions and they seem ok

[0][root@export]# ls -l
total 8
-rw------- 1 2000 2000 5214 Feb 12 16:12 cn3nx158ytnkuq8x6tbet9meee_export.zip

that seems to be the solution! I need to declare the internal path to mmctl

docker exec -ti docker-xxxx mmctl import validate /mattermost/data/6cf85fx7nbnwjqresq3mamwbbr_export.zip --local