Mattermost backup and restore
Keep the message database, server configuration and user-uploaded file store synchronized.
Last updated
On this page (5)
Mattermost · Backup and restore
Before you start
- Matching server release and compatible PostgreSQL tools.
- Maintenance window to stop all application writers.
- An isolated target and a separate test bucket if using S3.
Procedure
- Stop application writers for a consistent cut. Run
pg_dump -Fc -f mattermost.dump mattermostusing the configured connection. - Copy
config/config.json, referenced SAML certificates and local files from./dataor the configured Directory; record environment overrides. For S3, protect the bucket with its own backup or version policy and record the recovery point. - Run
pg_restore --exit-on-error -d mattermost_test mattermost.dumpagainst an empty target with suitable roles, restore configuration and files, then change only environment-specific settings to point to test dependencies before startup.
Verify the result
- Log in and sample a private channel’s history and a known uploaded file.
- Confirm restored configuration points only at test database, object storage and integration endpoints.
