Ein kurz howto zu einem „verschlafenen“ Mattermost Upgrade auf Version 3.1. Die lange Variante kann man hier nachlesen. apt-get update/upgrade hat mittlerweile die GitLab Version
:~# dpkg -l | grep gitlab ii gitlab-ce 8.9.6-ce.0
installiert. Der übliche https Aufruf zu Mattermost brachte nur ein nginx 502 Bad Gateway zu Tage. Im mattermost.log finden sich weitere Hinweise.
:~# less "/var/log/gitlab/mattermost/mattermost.log" [...] [2016/07/13 17:22:59 CEST] [CRIT] The database version of 2.2.0 cannot be automatically upgraded to 3.0 schema [2016/07/13 17:22:59 CEST] [CRIT] You will need to run the command line tool './platform -upgrade_db_30' [2016/07/13 17:22:59 CEST] [CRIT] Please see 'http://www.mattermost.org/upgrade-to-3-0/' for more information on how to upgrade.
Backup der Mattermost Datenbank.
:~# su - gitlab-psql $ /opt/gitlab/embedded/bin/pg_dump -h /var/opt/gitlab/postgresql mattermost_production | gzip > mattermost_dbdump_$(date --rfc-3339=date).sql.gz :~# zless /var/opt/gitlab/postgresql/mattermost_dbdump_2016-07-14.sql.gz -- -- PostgreSQL database dump -- SET statement_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; [...]
Das Upgrade der Datenbank von Hand anstoßen.
:~# su - mattermost $ cd /opt/gitlab/embedded/service/mattermost $ /opt/gitlab/embedded/bin/mattermost -config='/var/opt/gitlab/mattermost/config.json' -upgrade_db_30 Please see http://www.mattermost.org/upgrade-to-3-0/ **WARNING** This upgrade process will be irreversible. Have you performed a database backup? (YES/NO): YES We found 1 teams. teamchat Please pick a primary team from the list above: teamchat **SUCCESS** with upgrade
Abschließend GitLab rekonfigurieren und neu starten.
:~# gitlab-ctl reconfigure :~# gitlab-ctl restart ok: run: gitlab-workhorse: (pid 11917) 0s ok: run: logrotate: (pid 11923) 1s ok: run: mattermost: (pid 11930) 0s ok: run: nginx: (pid 11940) 1s ok: run: postgresql: (pid 11948) 0s ok: run: redis: (pid 11957) 0s ok: run: registry: (pid 11961) 1s ok: run: sidekiq: (pid 11969) 0s ok: run: unicorn: (pid 11975) 0s
Nach dem Neustart ist Mattermost mit den GitLab Accounts und Teamauswahl wieder zu erreichen.