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

ddev start could check to see if database type matches existing database type #3923

Closed
1 task done
rfay opened this issue Jun 18, 2022 · 5 comments
Closed
1 task done

Comments

@rfay
Copy link
Member

rfay commented Jun 18, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe

When you change the database type in config.yaml, you may or may not be able to start the project. It tries to upgrade if possible, but mariadb:10.3 to mysql:8.0 or postgres:14 will never ever work.

The previous version is actually stored in /var/lib/mysql/db_mariadb_version.txt, but it's hard to get at that (requires running a container with the volume mounted), so would slow down start.

But the results when somebody does a change are pretty ugly, and they have to do a ddev logs -s db to figure out what happened.

But ddev could store away the previous version, for example in ~/.ddev/global_config.yaml like it does with used_host_ports:

  d9mysql:
    approot: /Users/rfay/workspace/d9mysql
    used_host_ports: ["9999"]

Describe the solution you'd like

Above

Describe alternatives you've considered

Mounting the db volume and looking at the file.

Additional context

No response

@rogoit
Copy link

rogoit commented Aug 24, 2022

After update to version 1.21 i have this problem on every project. I fixed it with complete deletings and new setups. But on one project now i miss a google json file. So is there a easier way to do this

Failed to restart nca-sulu: Unable to start project nca-sulu because the configured database type does not match the current actual database. Please change your database type back to and start again, export, delete, and then change configuration and start. To get back to existing type use 'ddev config --database=' and then you might want to try 'ddev debug migrate-database mariadb:10.6', see docs at https://ddev.readthedocs.io/en/latest/users/extend/database_types/

@rogoit
Copy link

rogoit commented Aug 24, 2022

Maybe this helps

ddev debug get-volume-db-version
Failed to get existing DB type/version: could not split version string 10.3

@rogoit
Copy link

rogoit commented Aug 24, 2022

Also replace mariadb and mysql with

database:
type: mariadb
version: 10.6

still this issue

@rfay
Copy link
Member Author

rfay commented Aug 24, 2022

You're in the wrong issue here. The issue is #4129 and you'll find a couple of solutions there, and also in top of the release notes, https://github.com/drud/ddev/releases/tag/v1.21.1

@rogoit
Copy link

rogoit commented Aug 24, 2022

This scrip and @rfay on discord helps me https://gist.github.com/rfay/27b12e49ceb1ed1e3959c603401b7010

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

No branches or pull requests

2 participants