-
Notifications
You must be signed in to change notification settings - Fork 576
PostgreSQL 9.4 deprecated #489
Comments
Has someone tested how to do this?
|
Maybe it can be useful https://github.com/tianon/docker-postgres-upgrade |
Actually this is still using postgres 9.4 mattermost-docker/db/Dockerfile Line 1 in 124a8ba
|
Mattermost 5.30 is supposed to be out on December. I guess the version of postgresql on this repo will change in the same time? |
Anyone else find this alarming? |
I guess the best would be to handle db upgrade in entrypoint.sh script (or separated file)
can be done manually but would be nice to have it scripted to avoid any user errors |
Does this work? Why is no maintainer of this repo caring about this topic? If we would check the |
well the topic of this thread is not really correct, it is not the 9.6 which is deprecated but the 9.4 that the docker setup of mattermost currently still does use. ;-) Since I have not seen any progress on this topic so far, I did today, after I had upgraded Mattermost from 5.29.1 to 5.30.1, a manual upgrade of the database. But I did not use
this dropped the dump of the 9.4 data in the directory where my docker-compose.yml is also located. So I did restart the whole procedure again with the After the last upgrade to 13 I did at the end then enter the db container and did recreate the indexes: Now it is running on version 13 (actually 13.1) and everything runs fine. |
Well, thanks for the detailed explanation. I'm quite unsure if we really need to go through all of the versions in between. IMHO the dump should contain the data as well as the structure for the tables - no internal stuff that might has been changed..? |
I've used the images provided there to upgrade successfully from 9.4 to 13 in one step. Although I had to add
to my |
I'm going to try this. |
Yes, it starts and I have not yet seen any errors related to the database. (But I'm only running a small server.) |
Okay, I also can confirm that it's still running with v9.4. After this test I upgraded my instance like proposed from @GuidoDr, but in only one step from 9.4 to 10.1. Now, everything seems to be fine. |
@amyblais Is there anything planned to solve this problem? |
The upgrade using @tuxity/@philipkozeny method I get the following issue. |
Are we getting scripted version of the update from the maintainers? |
I also have that in my logs when starting (afaik this happened before with a previous upgrade), does this affect your installation? |
As it was an |
@GuidoDr oups, you are right, it's 9.4 not 9.6, was a mistake. I have edited the title. |
Thanks for letting us know! The issue was escalated earlier, and our build engineer will be looking at this. |
I upgraded to Postgres 13.1 by using most of the instructions from @GuidoDr (thank you very much!). I did skip from 9.4 to 13.1 directly, though (with backup, of course!) and so far everything looks fine. I did not need to add anything to I do see the index error mentioned in #411, but that's not a new thing AFAIR. |
I did the migration again and everything seems to work. So hopefully the error about |
Do you have any news ? |
DB upgrade is now required.. |
The 5.32 is released now. Is pg 9.4 still compatible for 5.32? |
No. |
Any news on this? |
The mattermost app from the app store in iOS was also showing the error that the server version is not supported anymore. Upgrading to the latest version of this repository's master branch did not help, so I ran the instructions in this thread. @bor8 Your additional upgrade suggestions helped a lot, thanks. I was also facing the issue:
The script provided by @coltoneshaw ran afterwards.
The mattermost app on iOS showed the version error again once, but now after restarting it, everything seems to work. Will this script be provided on the master branch as part of the upgrade process now? |
This is a breaking change to the db image version. A major version bump should have been issued or an automatic Postgres migration done. |
I did the upgrade and I can only tell everyone to wait. The upgrade went smooth but the plugin migration did not. I had to delete plugins, convert plugin api users into regular user to delete them and reinstall plugins in order to fix them. Startup raven still does not work. So if you upgrade I would delete all plugin and reinstall them afterwards in the hope that prevents them from breaking. Plugins that broke for me:
|
I am using a external MySQL server and I am stuck at 5.31.6 version due to this issue. Upgrade with |
On my side, I forked this repos, changed the Dockerfile for database, to use postgresql 13.
And it's working. |
Thanks, that helped a lot :)
Hope that saves some time for people =) |
Nice. But: Can you mark |
Thanks for the hint. I edited the comment and also updated the steps to also cover the dump process :) |
i tried to do the update as mentioned but my app container afterwards is complaining that it can't connect to the db. maybe somebody has an idea what i'm missing? |
@zwnk Perhaps your issue is the same as the one of @daydr3am3r, related to the postgres user?
Like @tuxity said before:
(I don't know if this is your case, you haven't posted your exact error, but if the credentials in the script are different than the ones in your docker-compose file, you should give it a try) |
of course i changed the credentials to the credentials used in my docker-compose file. but after the update script ran, the app container isn't able to connect to the db(invalid credentials). i checked the credentials at the config.json of the app container, they are also correct. don't know what is going wrong. i rolled back to the backup but still have the updated version sitting around, maybe i check it later tonight. |
Okay, so as someone who used the upgrade script provided above, what must be done to continue to update to the latest versions of Mattermost? Do we just update the version number in the app/Dockerfile and then upgrade as normal? |
Same here ! I have my docker-compose with db image of mysql:8.0.20 and my current version of the App is relase-5.29, when updating to release-5.33 looks as all the data dosent show up in the chats. version: "3.7"
services:
db:
image: mysql:8.0.20
environment:
MYSQL_ROOT_PASSWORD: $PASSWORD
MYSQL_DATABASE: $DB
MYSQL_USER: $USER
MYSQL_PASSWORD: $PASSWORD
command: mysqld --default-authentication-plugin=mysql_native_password
volumes:
- ./volumes/db/mysql:/var/lib/mysql
ports:
- "3306:3306"
networks:
- my-network
app:
#image: mattermost/mattermost-team-edition:release-5.33
image: mattermost/mattermost-team-edition:release-5.29
container_name: mattermost-docker_app_1
restart: unless-stopped
volumes:
- ./volumes/app/mattermost/config:/mattermost/config:rw
- ./volumes/app/mattermost/data:/mattermost/data:rw
- ./volumes/app/mattermost/logs:/mattermost/logs:rw
- ./volumes/app/mattermost/plugins:/mattermost/plugins:rw
- ./volumes/app/mattermost/client-plugins:/mattermost/client/plugins:rw
- /etc/localtime:/etc/localtime:ro
ports:
- "8000:8000"
environment:
- MM_USERNAME=$USER
- DB_PORT_NUMBER=$DBPORT
- MM_DBNAME=$DBNAME
- DB_HOST=$MY_IP_HOST
- VIRTUAL_HOST=mattermost.mydomain.com
- VIRTUAL_PORT=8000
- LETSENCRYPT_HOST=mattermost.mydomain.com
- MM_PASSWORD=$PASSWORD
- MM_SQLSETTINGS_DRIVERNAME=$DNAME
- MM_SQLSETTINGS_DATASOURCE=$DB_CONTAINER_URL_WITH_CREDENTIALS
networks:
- my-network
networks:
my-network:
external:
name: my-network |
First of all: Thank you for your work @mattermost team :) I wonder: what is the final migration plan? Does it exist? Will there be an automatic migration option "at some point", or will manual steps (like some guides here) have to be taken to ever upgrade to a newer version? Thanks a lot! |
All: While I can't fix the situation for you, I can suggest a course of action to the mattermost team. The reason the update is problematic is that updating postgres between major version require some difficult manual procedure (running pg_upgrade) Since I was in the same problematic for an open source project of mine, I am here to suggest a solution to the mattermost team so that updating would not require any manual intervention for the users. The idea is that in your docker entrypoint, you should add some script which check the current version of postgres, and if not the right version, download the right binaries and run pg_upgrade. The plan of action would be:
My commit on btcpayserver/btcpayserver-infra@e29b1ee does not work because mattermost-prod-db is still based on postgres 9.4. But if it was version 13, my In reality, the content of By doing so, your users will get upgraded without any manual intervention and difficult documentation. If some of you want to be unstuck, I would suggest you to try to build mattermost-prod-db by yourself with postgres 13, and follow my example on btcpayserver/btcpayserver-infra@e29b1ee . This should work. (make your backups before though) The only downside is that you need 2x the storage. Since the upgrade, dump the DB then reimport it. |
Now i've the error : database "mattermost" does not exist !!! |
I have used the instructions here #489 (comment) I had to add this to get the alpine postgres db image working:
Because of this packaging inconsistency bug in Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12763 Also I'd like to suggest this change:
Also the last line didn't work for me. I changed it to:
|
After upgrade (docker and steps from @coltoneshaw scripts):
The problem seems to be described 13 hours ago on mattermost.atlassian.net MM-37202
It is not entirely clear, this will be fixed in the next. version? |
@maxozerov We do not have an ETA at this time for the fix, but in a discussion with our Engineers, they believe this error is not a regression and there is no loss in functionality; it seems it is just an invalid error and not caused by the upgrade. If you do have functionality loss, we would like to learn more about your environment and the behavior you are seeing as a result. |
For anyone else following along on this issue, please see this note for more information and context of the solution. |
MM 5.26 now supports PostgreSQL 10+, since 9.4 is now deprecated.
https://docs.mattermost.com/administration/changelog.html#compatibility
We need to update https://github.com/mattermost/mattermost-docker/blob/master/db/Dockerfile#L1 to tag
:10-alpine
and provide a documentation to correctly upgrade database withpg_upgrade
The text was updated successfully, but these errors were encountered: