Export Mattermost data from Qnap NAS

The situation:
I have used Mattermost on my Qnap NAS in my company for some years now. It was installed as the official App in the Qnap store. The App got updates until version 5.0.0.10 until support stopped.

I now try to migrate the data to a new install on a self hosted server.

It took me some time to find out where on the Qnap Mattermost got installed. I think it lives in
/share/CACHEDEV1_DATA/.qpkg/mattermost/

but there is also another directory within this directory at
/share/CACHEDEV1_DATA/.qpkg/mattermost/volumes/app/

What I tried:
I tried to use the CLI like described here:
https://docs.mattermost.com/manage/bulk-export-tool.html

But I do not know a password of the “mattermost” user in order to switch to it nor did any of the commands work.
Can anyone point me in the right direction of how to get this export working?

Hi Varingo! As a starting point, be sure to check the official guide for details: Mattermost Bulk Export. Let us know if you need further help!

Hi John,

I already tried to follow the official guide like I mentioned above but without success.

mmctl did not get found so I tried the export with the CLI like described here:

The result was this:

It could not find a user “mattermost” so I tried to find the correct username in the config.json file.

But that didn’t work either:

I am not very good at working with the CLI so maybe I make some very basic mistakes I am not aware of.

In your example, mmuser is the database user.

Your version of Mattermost is beyond ancient. You’re going to have a bunch of issues here. You can use sudo find / -name 'mattermost' to locate your mattermost binary, then do an ls -l on it to find the user who owns it. That’s the user you’d need to sudo as. Look in the directory that contains that binary for mmctl… it may not be there in such an old version. If not, check Releases · mattermost/mmctl · GitHub I don’t see a download for 5.0.0.10, nor do I see any evidence in our version archive that there was ever any such version. You may have an issue where QNAP did their own bundling years ago, stopped, and left you in an odd position.

I would get the database and object store backed up. Then copy everything to a VM (because there’s a good chance things can start to break in interesting ways!) and try a manual upgrade to 5.0.3, and then to 5.9.8, then 5.19.3 At that point, there’s a supported mmctl. I would keep upgrading from ESR to ESR (search for "Extended Support Release) in the version archive) until you get to 9.11.x or 10.5.x And then migrate your database to Postgres Migration guidelines from MySQL to PostgreSQL - Mattermost documentation

I would not recommend continuing to run natively on the QNAP… it isn’t supported, and we have no idea what theings they’ve done to their OS. It’ll be a lot easier to get help if you’re running on plain ol’ Ubuntu or debian or RHEL.

1 Like

Hi John,
Thanks for taking the time to respond to this odd problem.
Yes the version is ancient and I really hope I can get my data out of this Qnap prison. As I am a completely useless navigating Linux (I don’t know even the most basic stuff) and therefore would even pay somebody to get it all transferred to a regular Ubuntu webserver. I might then manage to do the update path you described by myself.

This is the result of the command " # sudo find / -name ‘mattermost’ " logged in the Qnap as admin user:

[~] # sudo find / -name 'mattermost'
/share/CACHEDEV1_DATA/.qpkg/mattermost
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/sites-available/mattermost
/share/CACHEDEV1_DATA/.qpkg/mattermost/volumes/app/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/4e23760902168ade5e2a356ba96d4d6431c4f8f3d2cf345185d0fddd4b7890f4/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/4e23760902168ade5e2a356ba96d4d6431c4f8f3d2cf345185d0fddd4b7890f4/merged/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/4e23760902168ade5e2a356ba96d4d6431c4f8f3d2cf345185d0fddd4b7890f4/merged/mattermost/bin/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/547fb485c7fae1aa30d21589f3b2a275b8889ef64aa32b961ad95b5f8c1abeaa/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/547fb485c7fae1aa30d21589f3b2a275b8889ef64aa32b961ad95b5f8c1abeaa/diff/mattermost/bin/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/9a1b819f116f9e9ad5c38b41793225ec05f3f7dd6755afbc942082dc5e9ba8be/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/9a1b819f116f9e9ad5c38b41793225ec05f3f7dd6755afbc942082dc5e9ba8be/diff/mattermost/bin/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/40afac60aff2e6e91ede028c4ab6c3b871bdc141bde50df3587388ea5e8bb36a/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/40afac60aff2e6e91ede028c4ab6c3b871bdc141bde50df3587388ea5e8bb36a/diff/mattermost/bin/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/282e85dbb9f0a94d38cfdae1cd3266dc828cd7d524554c0afac17f0601a9f007/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/282e85dbb9f0a94d38cfdae1cd3266dc828cd7d524554c0afac17f0601a9f007/diff/mattermost/bin/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/085eb10299bd1f5b15be064576bced2b96f9671d96fb26f7d9047a42eda55b6d/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/085eb10299bd1f5b15be064576bced2b96f9671d96fb26f7d9047a42eda55b6d/diff/mattermost/bin/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/997672b49bb2ada0bb757548c176b0ddf441d531e79eca93885a4a7338dc916e/diff/mattermost
/share/CACHEDEV1_DATA/.qpkg/container-station/system-docker/overlay2/997672b49bb2ada0bb757548c176b0ddf441d531e79eca93885a4a7338dc916e/diff/mattermost/bin/mattermost
find: /share/CACHEDEV1_DATA/.qpkg/HD_Station/share: Permission denied

How would I identify the directory of my current mattermost install?
I guess I would have to run the ls -l command in this directory then.

This is the exact version:

I found the following thread from a user who had exactly the same problem and seems to have solved it:

He was also trying to locate where Mattermost is installed on the Qnap NAS and posts this as his solution:

Unfortunately he didn’t post the full path name so I ran the find command to find this directory.

[~] # sudo find / -type d -name "system-docker" /share/CACHEDEV1_DATA/.qpkg/container-station/var/run/system-docker /share/CACHEDEV1_DATA/.qpkg/container-station/run/system-docker /share/CACHEDEV1_DATA/.qpkg/container-station/system-docker

It found multiple directories with that name and none seems to include a directory named “mattermost”. I start to think that Mattermost is not installed in a docker container on my NAS but what do I know?

I am stuck again but maybe with a little help I can get closer to finding the install directory of Mattermost.

After not being able to find the directory on my Qnap Nas where Mattermost is installed I asked Qnap support. This is the answer I got:

I then tried to run any of the CLI commands starting with “mattermost” in any of these directories:

But no luck. The documentation says Mattermost is installed in mattermost/bin but I could not find a /bin directory where Qnap support says MM is installed.

I can’t believe there is no way in Linux to find where a program is installed.
What and how do I need to search for it?

@Varingo we just don’t know what QNAP did to package Mattermost so many years ago. You’re right… at your second arrow, there should be a /bin but there isn’t.

There area few other ways to try to puzzle this out, but they involve getting into the Linux OS and digging with some tools that require some expertise. IMO you need to get a sharp Linux consultant.