Changes

Chat

1,714 bytes added, 21:48, 3 December 2021
/* Mattermost (Current) */
== Upgrade ==
=== Mattermost (Current ) ===
Work in progressIMPORTANT: Read the update notes before https://docs.mattermost.com/upgrade/important-upgrade-notes.html
<pre>
# Backup
ubuntu@k8s:~$ sudo rsync --exclude=data/ -av /srv/chat.fixme.ch/ /root/backup-chat-$(date +'%Y-%m-%d')/
# Upgrade
</pre>
=== Old PostgreSQL ===
* This is outdated since we migrated to KubernetesExample d'update de postgresql
Creation d'un nouveau deployment avec la nouvelle version, en parallèle de l'actuelle dans objects.yaml
<pre>
# ssh root@chat.fixme.chapiVersion: v1systemctl stop kind: PersistentVolumemetadata: labels: type: local name: mattermost-postgresql-10autopostgresqlbackup namespace: mattermostls spec: accessModes: -l ReadWriteOnce capacity: storage: 20Gi hostPath: path: /varsrv/lib/autopostgresqlbackup/daily/mattermostchat.fixme.ch/postgresql-10
su apiVersion: v1kind: PersistentVolumeClaimmetadata: name: mattermost- chatpostgresql-10 namespace: mattermostspec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi
# Get the TEAM edition (not the enterprise version)apiVersion: apps/v1# VERSION from httpkind: Deploymentmetadata: labels: app: mattermost tier: db name: postgresql-10-db namespace: mattermostspec: replicas: 1 selector: matchLabels: app: mattermost tier: db template: metadata: creationTimestamp: null labels: app: mattermost tier: db name: mattermost-10-db spec: containers: - image: postgres:10.16 imagePullPolicy: IfNotPresent name: postgresql-10-db ports: - containerPort: 5432 protocol: TCP resources: {} terminationMessagePath:/dev/about.termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /var/lib/postgresql/data name: db env: - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: key: db-root name: mattermost.com/downloadenv dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 volumes: - name: db persistentVolumeClaim: claimName: mattermost-postgresql-10</pre>
cd mattermostCreation des objets, backup de l'ancienne db et import dans la nouvelleVERSION=3.6.2<pre>OLDVERSION=$(mkdir /homesrv/chat.fixme.ch/mattermost/bin/platform version 2>&1 | head postgresql-10kubectl create -n 1 | awk '{print $2}') cdwget https://releases.mattermostobjects.com/$VERSION/mattermostyamlsudo docker exec k8s_postgresql-teamdb_postgresql-$VERSIONdb-linux59ffdffd84-amd64.tar.gzmv mattermost mattermostpb2pg_mattermost_87151477-$OLDVERSIONtar xvf mattermosta5bf-team11eb-$VERSIONbde2-linux525400731ac9_0 pg_dumpall -amd64U postgres > dump-9.tar4.gzsqlrsync sudo cp dump-a 9.4.sql /mattermost-$OLDVERSION/configsrv/ chat.fixme.ch/mattermost/configpostgresql-10/.exit setcap cap_net_bind_service=+ep /home/chat/mattermostsudo docker exec -it k8s_postgresql-10-db_postgresql-10-db-558644f4fd-6g5lw_mattermost_bb97a762-a5c5-11eb-bde2-525400731ac9_0 /bin/platformbashsystemctl start mattermosttail pgsql -F U postgres < /homevar/chatlib/mattermostpostgresql/logsdata/mattermostdump-9.4.logsql
</pre>
 
A terminer:
- switch vers la nouvelle version
== Channel naming convention ==
ControlGroup, administrator
4,237
edits