Matttermost, Inc.

Is Mattermost Backup included in GitLab Backup?

Hello,

as the title says, contains the GitLab backup created with “sudo gitlab-rake gitlab:backup:create” the Mattermost data?

Thx,

Veit

Hi @VeitWeber,

Reviewing the GitLab Backup documentation we don’t believe it includes Mattermost. It seems to focus on repos, issues, wiki and metadata.

If you want to backup Mattermost you can snapshot the database, config.json, and also the Mattermost binary to stay on the right version, and you should be able to migrate or restore from there,

Does this help?

Thank you very much for your response and the informations you provided.

Is there a offical way or script to backup Mattermost when installed with GitLab’s-Omnibus yet?

Not yet, anyone from community open to sharing a backup procedure they use already?

It’s not. I was using a gitlab backup to migrate between two gitlab servers, and it didn’t migrate mattermost together with the rest of the gitlab stuff.

So I followed this [Solved] How do I back up a GitLab Mattermost database? to dump the database, and I was trying to import the database with sudo -u mattermost /opt/gitlab/embedded/bin/psql -U gitlab_mattermost -h /var/opt/gitlab/postgresql -p 5432 mattermost_production < mattermost_production_backup, but there were many errors with relations already existing.

What’s a good way to restore the database?

Could you share errors you’re seeing on the restore?

By the way, we now have documentation on backing up Mattermost databases outside of GitLab and on migrating Mattermost out of GitLab

I ran into the same issues, what you need to do is drop the existing database, createa new one, then run the database restore:

dropdb -h /var/opt/gitlab/postgresql/ mattermost_production
createdb -h /var/opt/gitlab/postgresql/ mattermost_production
gunzip -c ~/mattermost_dbdump*.gz | psql -h /var/opt/gitlab/postgresql mattermost_production