YunoHost-Apps / mattermost_ynh

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

Merge testing into master (migration to PostgreSQL, change arm64 source, Matermost v7.5.2) #411

Closed ericgaspar closed 1 year ago

ericgaspar commented 1 year ago
ericgaspar commented 1 year ago

!testme

yunohost-bot commented 1 year ago

Meow :cat2: Test Badge

kay0u commented 1 year ago

From #377

I think it’s okay to merge this into testing.

But IMO, before releasing it, we should still handle the case of the Focalboard plug-in on 7.3 installation, which in the current state is going to break the upgrade on many 7.3 systems.

@kemenaran how can i generate this error?

kemenaran commented 1 year ago

@kay0u I think the steps would be:

  1. Install Mattermost 7.2 on Yunohost, using the current master
  2. Ensure the Boards plug-in is installed and activated (otherwise install it from Mattermost’s Marketplace)
  3. Upgrade to Mattermost 7.3, using this commit : https://github.com/YunoHost-Apps/mattermost_ynh/commit/1677cb9fa9d95ab788a6acd5b310b09c7d2ab7df (which was available for a few days, then reverted)
  4. The Boards plug-ins should be disabled, because its migrations failed on MariaDB. The schema of the focalboards table will stay on the 7.2 version (instead of 7.3).
  5. Upgrade to Mattermost 7.5, using the current testing branch (This will attempt to migrate from MariaDB to Postgres)

At this stage, the pgloader migration should fail entirely, when it attempts to load the focalboard_* tables from a 7.2 schema (on MariaDB) to a 7.3 schema (on Postgres).

This is an issue because the Boards plug-in went pre-packaged with Mattermost at some point, and so was installed by default.

kemenaran commented 1 year ago

@kay0u otherwise, some simpler steps to simulate the same issue:

  1. Install Mattermost 7.2 or 7.3
  2. Stop the Mattermost server
  3. Connect to the MySQL database manually, and create a column focalboard_blocks.workspace_id with a single value
  4. Try to migrate to Mattermost 7.5

This should fail in the same way (because the column focalboard_blocks.workspace_id doesn't exist in the target schema).

kay0u commented 1 year ago

¯\_(ツ)_/¯ This makes the migration from 7.3.0 to 7.5.2 pass on my side

kemenaran commented 1 year ago

@kay0u yay! I tried to play with pgloader’s EXCLUDING TABLES MATCHING s/focalboard_/, but couldn’t get it to work. I guess the brute-force solution is good too. Thanks!

kemenaran commented 1 year ago

I wrote a request for testing on the Yunohost forums; I guess we can merge this after a few successful migration reports.

kay0u commented 1 year ago

@kay0u yay! I tried to play with pgloader’s EXCLUDING TABLES MATCHING s/focalboard_/, but couldn’t get it to work. I guess the brute-force solution is good too. Thanks!

I managed to make it work:

EXCLUDING TABLE NAMES MATCHING ~/^focalboard_/

https://access.crunchydata.com/documentation/pgloader/3.6.3/pgloader/

A regular expression begins with a tilde sign (~),

ericgaspar commented 1 year ago

shall we merge?