Mattermost Peer-to-Peer Forum

Resetting Gitlab Omnibus Mattermost installation


#1

Hi Team,

I am trying to completely reset the Mattermost part of my installation.
So basically something like gitlab-ctl cleanse but only for mattermost.

Is this easily possible?


#2

:+1:

This would hugely helpful. Our early testing has gone very well, but we want to wipe the slate clean before we start using it more broadly.


#3

Hi @micheee, hi @Zuhkov,

Requests for additions to gitlab-ctl would need to go into GitLab’s system, not sure the perfect place but maybe start with https://gitlab.com/gitlab-org/omnibus-gitlab/issues?

Mattermost is design as an archive, so there’s not a straight forward way to reset the database right now. We’ve created a ticket to track the addition of a “Reset Server” command to ./platform that could do something similar to what’s being requested of gitlab-ctl: https://mattermost.atlassian.net/browse/PLT-975


#4

Thanks, to both of you!
I see that adding such a feature to platform makes much more sense. I will read through the story and maybe add a thought if necessary :thought_balloon:.

Thanks for a great tool that’s fun to use.


#5

Here’s what worked for me (use at your own risk):

  1. Login to the database

     sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
    
  2. Drop mattermost DB

     drop database mattermost_production;
    
  3. Exit (\q) and run

     gitlab-ctl reconfigure
    

The last step will recreate the database


Weird login page with no login button, menu, or anything
#6

I think the way you’ve outlined it in your ticket will cover it, generally.

Couple questions/observations:

  • In the omnibus builds ./platform becomes ./mattermost. Having that info (plus the default path) in the docs would make things a lot easier when dealing with the CLI.
  • Who handles the integration of Mattermost into GitLab Omnibus? It seems like it would relatively simple to put together some kind of analogue for @3rdcycle’s solution, but would the Mattermost team handle that or would the GitLab guys do that?

#7

Great answer. Helped me a lot!


#8

I tried to drop the database as described by @3rdcycle, but the command gitlab-psql cannot be found.

I used omnibus installation for Gitlab 8.0 and upgraded recently to Gitlab 8.4 (Mattermost 0.7-Beta to 1.4.0 respectively).

How can I launch the gitlab-psql command?


#9

Did you forget the -u? gitlab-psql is the user under which the command (psql) is executed, not the command itself.


#10

You’re right :blush:

sudo isn’t installed, therefore I had missed that. Used instead su gitlab-psql. Thanks!


#11

That ticket is now closed but only the first two commands have been added to ./platform, as far as I can see. Is a full reset command off the table?


#12

I’m not understanding how this works. I can’t seem to figure out how to reset Mattermost on my GitLab installation. Can someone clarify this?


#13

I dropped the mattermost database as described by @3rdcycle. Now Mattermost is showing the following error

GitLab Mattermost needs your help:
We could not get all teams

UPDATE

I disabled mattermost integration. Executed gitlab-ctl reconfigure. Re-enabled mattermost and again executed gitlab-ctl reconfigure. This time it worked.