Here’s what worked for me (use at your own risk):
-
Login to the database
sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
-
Drop mattermost DB
drop database mattermost_production;
-
Exit (
\q
) and rungitlab-ctl reconfigure
The last step will recreate the database