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"?
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.
This will put it in the same directory as gitlab-rake gitlab:backup:create uses, so if you script it to run after that, you can just copy the whole /var/opt/gitlab/backups directory out to where you need it.