# NAS backup procedure

**URL:** <https://forum.mattermost.com/t/nas-backup-procedure/14250>\
**Category:** Troubleshooting\
**Created:** [October 14, 2022, 9:05am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250 "2022-10-14T09:05:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [October 14, 2022, 9:05am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/1 "2022-10-14T09:05:48Z")

</div>

Hi,  
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 🙂 ).  
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!

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [October 20, 2022, 5:22pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/2 "2022-10-20T17:22:58Z")

</div>

Hi wdbusy and welcome to the Mattermost forums!

> [@wdbusy](#):
>
> Mattermost Version: 5.0.0  
> Database Schema Version: 5.0.0

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:

```auto
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:

```auto
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 ☹

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [October 21, 2022, 10:12am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/3 "2022-10-21T10:12:01Z")

</div>

**Hi agriesser thank you so much for your reply!**  
finally a bit of light on this issue: find the folder is the first step: 😅  
 ![mm5](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/3/3752b698fc76a5b2d0fc2737afe99de1ef7805c4.jpeg)

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 :

/share/CACHEDEV1\_DATA/.qpkg/mattermost/volumes/db/var/lib/postgresql

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!

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [November 26, 2022, 4:00pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/4 "2022-11-26T16:00:51Z")

</div>

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 🙂

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

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

```

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

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [November 28, 2022, 9:44am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/5 "2022-11-28T09:44:49Z")

</div>

Hello,  
as always thank you to keep live this thread !  
json file is here:  
`/share/CACHEDEV1_DATA/.qpkg/mattermost/volumes/app/mattermost/config/config.json`  
below the output requested.

```auto
/share/CACHEDEV1_DATA/.qpkg/mattermost
/share/CACHEDEV1_DATA/.qpkg/mattermost/.list
/share/CACHEDEV1_DATA/.qpkg/mattermost/images
/share/CACHEDEV1_DATA/.qpkg/mattermost/images/app.tar
/share/CACHEDEV1_DATA/.qpkg/mattermost/images/db.tar
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/sites-available
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/sites-available/mattermost-ssl
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/sites-available/mattermost
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/fastcgi_params
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/fastcgi.conf
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/mime.types
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/koi-utf
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/koi-win
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/nginx.conf.sample
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/scgi_params
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/uwsgi_params
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/win-utf
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/conf.d
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/conf.d/mattermost.conf
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/conf/nginx.conf
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/html
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/html/index.html
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/html/50x.html
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/lib
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/lib/libcrypt.so.1
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/lib/libdl.so.2
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/lib/libpcre.so.3
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/lib/libpthread.so.0
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/sbin
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/sbin/nginx
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/cert
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/cert/nginx.key
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/cert/nginx.pem
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/logs
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/logs/error.log
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/client_body_temp
/share/CACHEDEV1_DATA/.qpkg/mattermost/nginx/proxy_temp

and many other tmp folders.

```

I hope this will help you 🙄  
thank you!

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [December 1, 2022, 7:05pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/6 "2022-12-01T19:05:33Z")

</div>

> [@wdbusy](#):
>
> `/share/CACHEDEV1_DATA/.qpkg/mattermost/volumes/app/mattermost/config/config.json`

Alright, getting closer 🙂

Can you post the output of the following command (not sure if this tool is installed on a QNAP, so if it throws an error, try the second one):

```auto
jq .SqlSettings /share/CACHEDEV1_DATA/.qpkg/mattermost/volumes/app/mattermost/config/config.json
grep -A14 SqlSettings /share/CACHEDEV1_DATA/.qpkg/mattermost/volumes/app/mattermost/config/config.json

```

The output will contain a password, make sure to mask it with x’s f.ex., but do not change any non-sensitive information or the like.  
Also one more output I need (in the hope that it is available):

```auto
docker ps
ps ax | grep docker
ps ax | grep matter

```

Thanks!

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [December 2, 2022, 9:56am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/7 "2022-12-02T09:56:24Z")

</div>

Wow agriesser!,  
all(4) commands works,  
now I put the result of the **2nd**

 ![nas_ouput](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/4/415ab91b68c1403ab089d1ace554e04e66a99048.jpeg)  
just removed 4 chars and a pw.

and **4th** :  
2217 admin 944 S grep matter  
2516 2000 46076 S mattermost  
2840 admin 1212 S nginx: master process /share/CACHEDEV1\_DATA/.qpkg/mattermost/nginx/sbin/nginx -c /share/CACHEDEV1\_DATA/.qpkg/mattermost/nginx/conf/nginx.conf -p /share/CACHEDEV1\_DATA/.qpkg/mattermost/nginx/  
23279 70 14100 S postgres: mmuser mattermost 172.30.0.3(34430) idle  
31281 70 11888 S postgres: mmuser mattermost 172.30.0.3(37232) idle  
31282 70 14252 S postgres: mmuser mattermost 172.30.0.3(37234) idle

let me know what other is needed, and thank you !

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [December 2, 2022, 12:02pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/8 "2022-12-02T12:02:04Z")

</div>

Hmm… so `docker ps` did not return any output?

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [December 2, 2022, 1:28pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/9 "2022-12-02T13:28:54Z")

</div>

Yes of course ! All 4 commands work,  
what line/process are we looking for ?  
below all the lines tell me which one is needed, I will send it.  
(note the output is broken for now )

 ![nas_output_ps](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/0/0a8755771f50d76b4d3f58dcdacc1cc120aba8e1.jpeg)

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [January 10, 2023, 4:36pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/10 "2023-01-10T16:36:16Z")

</div>

Hi there,  
the last output wasn’t so helpful,I suppose or something it’s wrong ?  
Tell me !  
Thank you.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [January 23, 2023, 10:46am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/11 "2023-01-23T10:46:24Z")

</div>

Hi again,

I’m very sorry that I did not respond here anymore, it’s hard to debug an issue with a completely unknown platform.  
What QNAP system with what firmware version do you have? I’ll check if I can get one for testing for 1-2 weeks so I can then work on this equipment on my own and provide you with the relevant answers.

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [January 23, 2023, 1:47pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/12 "2023-01-23T13:47:29Z")

</div>

Hi, and thank you for your reply,  
is a small intel with fw: 5.0.0.2131 product :2 5 3be,hope this data could be useful.  
But I think no difference in any other model based on intel cpu (the MM app is on qnap official site!)

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [January 23, 2023, 2:13pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/13 "2023-01-23T14:13:45Z")

</div>

Thanks, what OS version do you have? QTS? QuTS hero or QES?  
Also, can you link me to the official qnap site where they talk about the Mattermost application?

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [February 23, 2023, 5:18pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/14 "2023-02-23T17:18:39Z")

</div>

Hi, sorry for the late but anyway : looking for “qnap mattermost” in a well known search engine 🙂 first result:  
“[Mattermost User Guide | QNAP](http://www.qnap.com/en/how-to/tutorial/article/mattermost-user-guide)”

it’s a “native” APP for qnap but unsupported by them. It runs on QTS (x86). (it was “update” recently but the core of the app is always 5.0, so old BUT it works)  
Hope can be useful.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [February 23, 2023, 7:19pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/15 "2023-02-23T19:19:52Z")

</div>

Of course I can google for how to set it up, but this does not answer how _YOU_ set it up and since you’re having a specific problem, I’m trying to find out how to reproduce your specific problem and the more detailed information I have, the better I’m able to help.

I’ll see if I can get my hands on a compatible box to run some tests on it, might take some time.

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [February 24, 2023, 11:39am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/16 "2023-02-24T11:39:24Z")

</div>

Sorry Agriesser, but can you be more clear about : “how YOU set it up”  
there is no paths or any “strange” command to do: select the app (MM) and the QTS install… it.  
NO docker no container (of course I suppose it will be used in some ways but isn’t show to the users.)  
for example a guide: you can scroll [Online zusammenarbeiten auf dem QNAP-NAS - so geht's!](https://basic-tutorials.de/ratgeber/software/online-zusammenarbeiten-auf-dem-qnap-nas/) (link direct to the image [https://basic-tutorials.de/wp-content/uploads/2022/08/2022\_08\_09\_basic\_tutorials\_QNAP\_zusammenarbeit\_BILD1.png](https://basic-tutorials.de/wp-content/uploads/2022/08/2022_08_09_basic_tutorials_QNAP_zusammenarbeit_BILD1.png))  
click on install (red arrow) and it’s done.  
Let me know.  
Thank you.

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [March 5, 2023, 2:13pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/17 "2023-03-05T14:13:48Z")

</div>

Hi Agriesser,  
just giving a look into config Json :  
Atrestencryptkey, datasource … values are useful for you ?

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [May 15, 2023, 1:16pm UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/18 "2023-05-15T13:16:15Z")

</div>

So any idea ?

to stop mattermost is there a CLI command to try in this environment ?  
thx

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [September 30, 2023, 11:00am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/21 "2023-09-30T11:00:06Z")

</div>

**UPDATE:**  
in qts there is another command “system-docker ps” I got now 2 lines:

```auto
2954xxxxxxx5 mattermost/app:3xxxxxxf "/entrypoint.sh matt…" 7 weeks ago Up 7 weeks 8065/tcp mattermost_ap p_1
fd63xxxxxxxf mattermost/db:3xxxxxxxf "/entrypoint.sh post…" 7 weeks ago Up 7 weeks 5432/tcp mattermost_db

```

xxxx covered some other real numbers/letter.  
Maybe is it a light at the end of the tunnel ?

---

<div class="post-metadata">

**Author:** ![wdbusy](https://avatars.discourse-cdn.com/v4/letter/w/ecae2f/32.png) [@wdbusy](https://forum.mattermost.com/u/wdbusy)\
**Post date:** [November 13, 2023, 11:32am UTC](https://forum.mattermost.com/t/nas-backup-procedure/14250/22 "2023-11-13T11:32:01Z")

</div>

🎂 over 1 year and counting… it’s a really hard question to solve for so interesting piece of friendly software! ☹
