Okay, I think I've made a bit of progress, but I'm still stuck. I found how to use the pg_dump command, but it's giving me the following error:
mattermost@git:~$ /opt/gitlab/embedded/bin/pg_dump mattermost_production > mattermost_production.bak
pg_dump: [archiver (db)] connection to database "mattermost_production" failed: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?