Bring up the db container only docker compose up -d postgres
Import the data docker exec -i docker-postgres-1 psql -U mmuser < ./backup/postgres13-update-backup.sql
When running step 3 i get psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: database “mmuser” does not exist
I know this is more of a docker/postgres issue but I’m reaching out here first. I’m not very good at these things.
I’m not using docker for production, but I do use it in a test instance for some internal tools development work. My guess is your compose file isn’t setting up the right user in your postgres container. This is what I have in my docker-compose.yml for the PG server:
If I bring up the stack now with .env MATTERMOST_IMAGE_TAG=11.0
I get a new error Error: failed to initialize platform: cannot create store: error setting up connections: pq: password authentication failed for user “mmuser”
I guess I need to work some more with the DB-backup / restore commands.
Or are there some official documentation from Mattermost how to migrate that I’ve missed?
(Since I’m using the example docker compose pattern)
Hey @ollejacobsen , thank you for the nice instructions.
I have a few improvements, that I unfortunately had to experience the hard way (data loss) - absolutely my own fault and just in a hobby project but maybe this can help others.
The name of the backup file (./backup/postgres13-update-backup.sql) and the restored file (./backup/postgres13-backup-mattermost.sql) do NOT match. These should be the same
make sure that the output of the backup step is written to console as well (e.g. using | tee) - I had a typo in the backup and did not notice because the error was just written into the backup file
should be common sense, but maybe add a step to check the backup content - I did not against better judgement. at least if there are some sensible looking lines in the sql dump
Thanks again for your effort of documenting the upgrade instructions