ddev / ddev-platformsh

Add integration with Platform.sh hosting service
Apache License 2.0
9 stars 10 forks source link

Database type change or version downgrade can be painful #12

Closed rfay closed 2 years ago

rfay commented 2 years ago

As with any database server, changing the server while keeping the same data may often not work out. For example, if you have a working database on MariaDB 10.3, and you change the server type to MySQL 8.0, it will choke on the way up. And DDEV currently has no easy way to know the type of the existing data, in /var/lib/mysql even though the type is in there in a file that DDEV adds, but it can't be seen without starting a container with that volume mounted.

People stumble on this regularly and the docs cover it, and it makes sense.

But it would be a much better user experience if we could:

Discussion in https://platformsh.slack.com/archives/C03GRG19L2E/p1654616860043129

This issue should probably be moved to drud/ddev, but dropping it here because it has significant impact on this project, where most people will probably have an existing mariadb:10.3 database (but possibly empty) before pulling this add-on, making it hard to give them the type they have in the upstream hosting (if it's different).

rfay commented 2 years ago

I've temporarily addressed this for mysql/mariadb only by adding a test inside the add-on to see if they're changing types or versions. It's a bit fragile, but better than not checking.