YunoHost-Apps / mattermost_ynh

Mattermost package for YunoHost
http://www.mattermost.org
GNU General Public License v3.0
33 stars 18 forks source link

MariaDB not supported: migrate to PostgreSQL? #367

Closed biva closed 1 year ago

biva commented 2 years ago

Hello,

I read on this thread from the francophone Mattermost community that MariaDB could create issues, and that Mattermost only supports MySQL and PosgreSQL: https://twitter.com/MattermostFR/status/1534838198286929920 Maybe @amyblais could confirm if it's true? It looks confirmed if I read the documentation: https://docs.mattermost.com/install/software-hardware-requirements.html#database-software

MariaDB v10+ no longer functions as a MySQL drop-in replacement, and it’s not supported for Mattermost due to the requirement of MySQL 5.7.12. Prior versions of MariaDB were not officially supported but may have functioned in older Mattermost releases. If you are running MariaDB now, migrating from MariaDB to the MySQL equivalent is recommended.

I'm not sure about what is used in this Yyunohost package? I see MySQL in https://github.com/YunoHost-Apps/mattermost_ynh/blob/master/scripts/install, but maybe it's MariaDB behind that?

Would you consider using PostgreSQL to secure a stable installation?

amyblais commented 2 years ago

Correct, we don't support MariaDB. There is also some more details in this thread here https://community.mattermost.com/core/pl/5m9mnur4ejn9z8c7c9dipaw7jc.

biva commented 2 years ago

Wow, thanks for your quick update @amyblais ! @kemenaran , what do you think is the best solution?

kemenaran commented 2 years ago

The script indeed doesn't mention MariaDB: it requests a MySQL setup from the distro. If the distro provides MariaDB instead, that's probably up to ensure the compatibility.

Migrating new installations to Postgres would be nice, but I'm afraid of the migration, and of supporting some setups on MariaDB and some others on Postgres (like how do we restore an older backup? Do we need both code paths?)

biva commented 2 years ago

Thanks @kemenaran, as far as I understand, Postgres is the preferred version, advised by Mattermost. In addition, I also understand that Debian ships MariaDB by default (if I trust this: https://www.how2shout.com/linux/how-to-install-mysql-8-0-server-on-debian-11-bullseye/). It means that most of the users will have MariaDB instead of MySQL, and that could lead to issues with Mattermost.

I think the safest solution would be to go for Postgres for all new installations. For old installations, I would push a migration. There's an existing discussion here, notably around pgloader: https://github.com/mattermost/mattermost-server/issues/18351

pgloader is notably advised by @wget in its tweet to the francophone community: https://twitter.com/MattermostFR/status/1534838206738403329

biva commented 2 years ago

Hello @kemenaran,

Mattermost is confirming that MariaDB is really not supported at all and might create issues (https://github.com/mattermost/mattermost-server/issues/18351#issuecomment-1157267477). Would it be possible to update the script so that it uses PostgreSQL for new installations? It will avoid issues for new users at least. I think the instructions here can help: https://docs.mattermost.com/install/install-debian.html#install-postgresql-database-server The script could also - temporarily - block the updates from now on for the ones using MySQL/MariaDB. This leaves some time to find a solution to migrate the existing installations.

What do you think?

biva commented 2 years ago

For information, I started to work on the documentation for the migration in https://github.com/mattermost/docs/pull/5729

biva commented 2 years ago

Hello @kemenaran, I'm not skilled enough to propose a change in the script to install Mattermost with PostgreSQL for new users. But I'd be happy to test it if you want (if it works on a Raspberry Pi)

biva commented 2 years ago

Hello @kemenaran, even if I'm not very skilled, I try to propose a change in the script to install Mattermost with PostgreSQL for new users. Would you be able to help me?

Install script: https://github.com/YunoHost-Apps/mattermost_ynh/pull/373 config.json: https://github.com/YunoHost-Apps/mattermost_ynh/pull/374 service: https://github.com/YunoHost-Apps/mattermost_ynh/pull/375

lenybernard commented 2 years ago

Upgrading today from 7.2 to 7.3 has broken Boards with the following log :

Unable to restart plugin on upgrade., error initializing the DB: MariaDB database is not supported, you can find more information at https://docs.mattermost.com/install/software-hardware-requirements.html#database-software

kemenaran commented 2 years ago

@lenybernard ouch, thanks for letting us know.

@ericgaspar I'll revert the current upgrade, until the postgres migration is ready. It seems better not to have user pressure when testing the migration :)

freddewitt commented 2 years ago

Hello all, i'm a simple user, is they anyway to give help ? Can we go back to 7.2 without losing what was writing since the 7.3 update ? Thanks

kemenaran commented 2 years ago

I tested reverting to Mattermost 7.2 from a 7.3 install – and it didn't work that well : user sessions were lost, and it seems passwords had to be reinitialized.

So there's no clear solution for making Boards work right now. I'm sorry for the inconvenience.

I guess that :

freddewitt commented 2 years ago

Hello

on your setup, you can try migrating from MariaDB to MySQL

Can you tell us how that could be done ? I did install Focalboard, it works well for now, but i rather prefer use it on mattermost :(

thanks for all guys

freddewitt commented 1 year ago

Est ce que ça serait pas plus simple d'aller vers MySQL depuis MariaDB ?

Wouldn't it be easier to go to MySQL from MariaDB?

ericgaspar commented 1 year ago

Closing with #411

biva commented 1 year ago

Yihaa! Congrats :)