Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA] Migration de MySQL 5.7 vers 8.0 #2289

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Conversation

emilschn
Copy link
Collaborator

@emilschn emilschn commented Feb 26, 2024

Ticket

#2102

Description

Scalingo nous propose de passer rapidement à MySQL 8, puisqu'ils vont arrêter la maintenance de MySQL 5.7 et migreront à partir du 1er juillet.
Par ailleurs, on pourra en profiter pour utiliser des fonctionnalités plus avancées à présent.

Afin de passer en MySQL 8, il y avait 2 vérifications à faire sur les tables (cf ici : https://doc.scalingo.com/databases/mysql/mysql-8-prerequisites) :

  • Toutes les tables utilisent le moteur InnoDB
  • Toutes les tables ont des clés primaires
    C'est bien le cas.

J'ai fait pas mal de tests, le passage à la version 8 semble indolore.
Lors du passage sur develop (lors du merge), il faudra

  • faire une sauvegarde de la base
  • passer MySQL en version 8 via le dashboard Scalingo sur l'app de staging
  • faire des tests sur staging

Changements apportés

  • Modification de la version de MySQL dans tous les fichiers de conf, environnements et doc.

Pré-requis

make build

Attention : quand vous revenez sur une autre branche, il faut faire

docker volume rm histologe_dbdata
make build

Tests

  • Faire des tests de navigation sur différentes pages sensibles (statistiques, listes de signalements, exports, actions utilisateurs...)

Copy link

sonarcloud bot commented Feb 26, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@emilschn emilschn changed the title [WIP] MySQL 8 [INFRA] Migration de MySQL 5.7 vers 8.0 Feb 26, 2024
@emilschn emilschn marked this pull request as ready for review February 26, 2024 11:29
@sfinx13
Copy link
Collaborator

sfinx13 commented Feb 26, 2024

Faudra aussi envisager de mettre le site en maintenance lors du passage 5.7 à 8

@hmeneuvrier
Copy link
Collaborator

Faire une reviewApp avec des données de prod pour tester en conditions réelles

Copy link
Collaborator

@numew numew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Une petite remarque, mais les test sont ok, j'approuve

@@ -6,7 +6,7 @@ doctrine:
url: '%env(resolve:DATABASE_URL)%'
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
server_version: '5.7.38'
server_version: '8.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas du tout bloquant mais ca fait revenir une déprécciation "User Deprecated: Version detection logic for MySQL will change in DBAL 4. Please specify the version as the server reports it, e.g. "8.0.31" instead of "8". (AbstractMySQLDriver.php:68 called by AbstractDriverMiddleware.php:68, doctrine/dbal#5779, package doctrine/orm)"

@sfinx13
Copy link
Collaborator

sfinx13 commented Feb 28, 2024

@numew @emilschn @hmeneuvrier
Pour revenir à la version 5.7 lors d'un switch de branche
https://mattermost.incubateur.net/betagouv/pl/se7mwfdrcpbmpcj1y7dw3oya5a

Copy link
Collaborator

@sfinx13 sfinx13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lecture et test OK

@sfinx13 sfinx13 marked this pull request as draft March 6, 2024 08:02
@sfinx13
Copy link
Collaborator

sfinx13 commented Mar 6, 2024

Je la passe en draft pour pas bloquer une possible MEP en cette fin de semaine.
Aprés avoir mergé faire des tests sur staging @emilschn @numew @hmeneuvrier

@sfinx13 sfinx13 marked this pull request as ready for review March 11, 2024 08:10
@sfinx13 sfinx13 merged commit 74e60f8 into develop Mar 11, 2024
3 checks passed
@hmeneuvrier hmeneuvrier deleted the feature/2102-mysql8 branch March 15, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants