[Solved] Migration import - Error: could not initiate client

I am attempting to do a DB migration from Mattermost’s cloud to a private server. I have installed mmctl.

When I execute the following instruction and enter my credentials I see the following error.

./mmctl auth login https://localhost
Error: could not initiate client: Post "https://localhost/api/v4/users/login": x509: certificate is not valid for any names, but wanted to match localhost

When I execute the following instruction and enter my credentials I see the following error.

./mmctl auth login host-name
Error: could not initiate client: Post "host-name/api/v4/users/login": unsupported protocol scheme ""

I am running mmctl on the same machine that is hosting the instance of Mattermost. Is it possible to su mmctl this way, and if so how do. I adapt the command such that it works.

Any help will be appreciated.

I have gotten around this by disabling TLS.

Hi Rochus,

same issue here,
can’t seem to find a way to import.

How / where, did you disable TLS on the private server please ?


Hi @17984403

In the “System Console”, you will find the settings for web server. I disabled from these settings, assuring the URL also used http as opposed to https.

Hope this helps,

Hi Rochus,

thanks very much for the information,
it’s now [solved] for me also.

When it was still unsolved,
I was using a bitnami VM as the Mattermost server,
(cf Mattermost Team Edition Virtual Machines)
which did not permit (or I couldn’t figure out how)
the settings needed to mmctl_auth_login (yes, it’s a verb) to a local mattermost server without SSL.

To achieve the [Solved] status in my case,
I installed a Mattermost Ubuntu server
(cf Install Mattermost Server on Ubuntu — Mattermost documentation)
and as all is not explained in the above URL,
I had, in addition to “mattermost”,
to apt-install and set
“default-mysql-server” (create a mysql_mattermost_user and and mysql_mattermost_DB)
and “nginx” (create /etc/nginx/sites-available/mattermost.conf and linked it to sites-enabled)

Once this done, like you said, via the web interface,
(in System Console → ENVIRONMENT → Web Server),
I set it to:

Site URL: #<-- IP of mattermost server on the LAN
Listen Address: :8065
Forward port 80 to 443: false #<-- it was already like that, greyed out, not updatable
Connection Security: None #<-- it was already like that

I also show below the modified parts in the config.json of mattermost
(of course, these are to edit according to your own settings)

        "SiteURL": "",
        "ListenAddress": ":8065",
		"DriverName": "mysql",
        "DataSource": "mysql_mattermost_user:mysql_mattermost_userPASS@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",
		"MaxFileSize": 10485760000, #<-- for the import, it's about 9GB, by default it's about a 100MB

then after a restart of mattermost service
I could successfully

mmctl --local auth login

from there I could,
with the zip file already on my local server
and so that it could be seen in “mmctl import list available”

mmctl import upload /SomewhereOnMyLocalServer/other_mattermost_server_export.zip

and then the real import in the local server DB
mmctl import process import_created_from_other_mattermost_server_export.zip

and wait until the status is “success” in the output of:
mmctl import job list

As a side note,
I think I understood the why of the mmctl error:
--> unsupported protocol scheme "" <--
it is when you don’t prefix a protocol (http or https) in the
“mmctl auth login” command
as in
mmctl auth login a_host_name

Thanks again,
and cheers

Thanks @17984403

Just to give a heads up

I am seeing an unexpected effect of which URL is used in this process. See here.