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

Allow exporting Drupal database to use locally, with DDEV. #10

Open
mglaman opened this issue Jun 28, 2024 · 4 comments · May be fixed by #53
Open

Allow exporting Drupal database to use locally, with DDEV. #10

mglaman opened this issue Jun 28, 2024 · 4 comments · May be fixed by #53
Labels
enhancement New feature or request

Comments

@mglaman
Copy link
Owner

mglaman commented Jun 28, 2024

The database is using SQLite which isn't compatible with MySQL as a dump. We can use Drupal's db-tools.php. But we'll need all driver modules enabled in the dump for it to work.

We can use db-tools.php and instructions for importing with DDEV

ddev php core/scripts/db-tools.php import whatever

See https://drupal.slack.com/archives/C072BF486FN/p1719591426354559?thread_ts=1719523715.328029&cid=C072BF486FN

@mglaman mglaman added the enhancement New feature or request label Jun 29, 2024
@mglaman mglaman added this to the Export to DDEV milestone Jul 10, 2024
@mglaman mglaman linked a pull request Jul 11, 2024 that will close this issue
@mglaman
Copy link
Owner Author

mglaman commented Jul 12, 2024

Tool that supposedly concerts SQLite to MySQL dump Grammer: https://www.rebasedata.com/convert-sqlite-to-mysql-online

Since Drupal's database statements should be fairly simple, we can manually check the differences and provide a script

@mglaman
Copy link
Owner Author

mglaman commented Jul 12, 2024

Also convert https://raw.githubusercontent.com/haiwen/seahub/master/scripts/sqlite2mysql.py to PHP as another option

@mglaman
Copy link
Owner Author

mglaman commented Jul 16, 2024

Converting SQLite to MySQL via a dump looks increasingly hard, making a version of https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Core/Command/DbDumpCommand.php?ref_type=heads work with SQLite seems way easier

@phenaproxima
Copy link

I'm not so sure about this. If you're using a SQLite database, it won't necessarily generate SQL that is portable to another DB backend. We can't rely on any given database generating portable SQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants