From 0c29dacaeb072e98672393b8ae96b428a6ac8171 Mon Sep 17 00:00:00 2001 From: maffe Date: Fri, 9 May 2025 18:17:05 +0200 Subject: [PATCH] Add Mattermost backup info --- source/index.rst | 1 + source/mattermost/backup/backup.rst | 15 +++++++++++++++ source/mattermost/backup/backup_db.rst | 20 ++++++++++++++++++++ source/mattermost/mattermost.rst | 9 +++++++++ 4 files changed, 45 insertions(+) create mode 100644 source/mattermost/backup/backup.rst create mode 100644 source/mattermost/backup/backup_db.rst create mode 100644 source/mattermost/mattermost.rst diff --git a/source/index.rst b/source/index.rst index 216cc52..ec65d48 100644 --- a/source/index.rst +++ b/source/index.rst @@ -19,6 +19,7 @@ This is an amazing documentation! Us oldie but goldie spidermen have documented ./framework_docs/framework ./examples/examples ./spider_conference/spider_conference + ./mattermost/mattermost spiderman_duties rostsystem template diff --git a/source/mattermost/backup/backup.rst b/source/mattermost/backup/backup.rst new file mode 100644 index 0000000..54cd137 --- /dev/null +++ b/source/mattermost/backup/backup.rst @@ -0,0 +1,15 @@ +Mattermost Backup +====================== + +To properly backup Mattermost, both the database and all the files/content need to be backed up. +Backing up the files is pretty easy, copying is good enough. + +To back up the database we need to first dump it to a file. On the server there +is a systemd service ``mattermost_backup.service`` which handles this. +See: :ref:`mm_db_backup`. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + backup_db diff --git a/source/mattermost/backup/backup_db.rst b/source/mattermost/backup/backup_db.rst new file mode 100644 index 0000000..0a2c261 --- /dev/null +++ b/source/mattermost/backup/backup_db.rst @@ -0,0 +1,20 @@ +.. _mm_db_backup: +Mattermost DB Backup +========== + + +There is a service and corresponding timer, +``mattermost_backup.service`` and ``mattermost_backup.timer`` +that regularly (once a week on saturdays as of 2025-05-09) uses ``pg_dump`` +inside the postgres service of the mattermost docker compose to dump the +database to a gzipped file in ``/fsek/mattermost_postgres_backup``. + +This +service assumes that: + +1. The directory ``/fsek/mattermost_postgres_backup`` exists +2. The mattermost ``docker-compose.yml`` is in the directory ``/fsek/mattermost_postgres_backup`` +3. The database is called ``mattermost`` and the user is named ``mmuser`` + +Note that if any of these change you **must** update +``mattermost_backup.service`` or else it will stop working! diff --git a/source/mattermost/mattermost.rst b/source/mattermost/mattermost.rst new file mode 100644 index 0000000..ba115a6 --- /dev/null +++ b/source/mattermost/mattermost.rst @@ -0,0 +1,9 @@ +.. _mattermost-guide: +Mattermost +========= + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + ./backup/backup