NAS backup procedure

MM is really a great software even for a small workgroup or a family.
Is’s working seamless on a NAS in private lan, is very useful indeed, quick and secure(at leas I suppose so :slight_smile: ).
I would backup all the posts images and video shared on a channel.

Has someone and idea how to backup it ?
Mattermost Version: 5.0.0
Database Schema Version: 5.0.0
Database: postgres

please remember ON a qnapNAS.
Other details : the MMapp is NOT on docker (it runs but no container is shown).
there are different folders hidden
using Putty via ssh ?
what commands ?

Of course a good backup is also useful if it be loaded and checked : in my mind the backup for all dbs will be loaded on a new MM version on windows (at example)?
Is it feasible? (or a linux machine??)

How ?

Is a really important question and Qnap seems not really interested to help me.
I hope in this forum to give some sort of support.
Thank you!

Hi wdbusy and welcome to the Mattermost forums!

I’m not sure if this version information is correct, this would be a very old version. Can you please login to your Mattermost server using the webapp and click on the menu at the top left then and on the “About” button at the bottom? I think there’s an issue with some clients that display the wrong server version in their own about screens.

Backing up Mattermost is actually pretty easy, not sure what instructions you followed and how your filesystem looks like now, but by default, Mattermost is installed to /opt/mattermost (this might be different on your QNAP installation) and it is connected to a database (in your case, a PostgreSQL database). Is it safe to assume that the PostgreSQL database is already hosted on your QNAP?

Not sure what tooling you have available here, but you could try to connect to your QNAP via SSH (using PuTTY on Windows, f.ex.) and once you’re logged in, elevate to a root account by using sudo or su - and then try to find the folders where Mattermost is installed.
Let’s say it’s installed in ´/opt/mattermost`, you would have to back up this folder then to get all your application data and attachments into a backup.
If QNAP has a tool to back up local directories, you could try to use that, otherwise you can always just create a zip file on the Linux CLI, f.ex. using the command:

tar czf /path/to/backup.tgz /opt/mattermost

This will create a zip file called backup.tgz in the directory /path/to/ which will contain all files and folders of the /opt/mattermost directory.
In order to back up the database, you would have to use a utility like pg_dump to dump the database.
Maybe QNAP also has a tool/config option available to store a backup of your databases, please check their configuration options, but if they don’t, you can try to manually back up the database using the following command:

pg_dump mattermost > /path/to/mattermost.sql

This command will dump the database called mattermost and will store it into the file /path/to/mattermost.sql.

Sorry for the vague instructions, but I do not have a QNAP storage at hand where I can try to install Mattermost on my own to see what the paths are and what tools are available :frowning:

Hi agriesser thank you so much for your reply!
finally a bit of light on this issue: find the folder is the first step: :sweat_smile:

First : QTS is 5.0 with last patches.
Mattermost is 5.0 yeap is really old… and I installed it as regular APP on nas using the “app center”,

About your tips :
unfortunately OPT just NOT contains any Mattermost is empty.
a folder with some mattermost: /share/CACHEDEV1_DATA/.qpkg/mattermost
but no db in it.
with winscp found some folders that contain mattermost /etc and /proc/
but in MM (console) under Local Storage Directory: there is “mattermost\data” SO ?

on the nas there is actually a db folder here :


I assume that a path for a db is written in somewhere… how to find it ? I was looking on .sh and .conf…
some environment variables
(MM is not visible on container station) while is running.

pg_dump command not found!
instead tar works (If only I could find what compress)
the solution is out there… but I cannot grab it.

Thank you anyway!

I can just guess here, since I do not have a system to reproduce that, sorry.
The database is not stored in a path, it’s basically a service running so inside Mattermost, you do only have the so-called “DSN” which points to your database.
The config file you’re looking for is called config.json and it should be in your mattermost installation directory, but we do not know where it is :slight_smile:

When you open a terminal on your NAS (or after you’ve SSH’ed into it), you could try to run the following command:

find /share/CACHEDEV1_DATA/.qpkg/mattermost | head -80

and post the output here - maybe it helps me to find out the next steps.

as always thank you to keep live this thread !
json file is here:
below the output requested.


and many other tmp folders.

I hope this will help you :roll_eyes:
thank you!