Developers sometimes need to work off of a non-production database dump. One such case is when a long-running migration branch is in active development and there are other development efforts that branch off of that branch. Devs branching off of the migration branch often find themselves needing to import a database dump from a “staging” or “dev” environment that has been set up to track the migration branch.
Currently, developers who want to use dev:refresh might do something like:
Run composer robo dev:refresh ddev. This imports the prod database.
Run ddev import-db --file=./some-non-prod-db-dump.sql.gz.
That certainly gets the job done, but on projects with database dump sizes in the gigabytes, it takes a very long time to actually refresh one’s dev environment. It would be really useful to be able to pass an option to the dev:refresh command which, when present, makes Robo skip the prod database download altogether and use the provided dump instead.
Issue Owner
@agarzola
Acceptance Criteria
[ ] A new option is available for the dev:refresh command that accepts a local path to a database dump file.
e.g. --db=./path-to-dump.sql.gz
[ ] When this option is used, dev:refresh skips the database download step and imports the provided database dump instead.
Description
Developers sometimes need to work off of a non-production database dump. One such case is when a long-running migration branch is in active development and there are other development efforts that branch off of that branch. Devs branching off of the migration branch often find themselves needing to import a database dump from a “staging” or “dev” environment that has been set up to track the migration branch.
Currently, developers who want to use
dev:refresh
might do something like:composer robo dev:refresh ddev
. This imports the prod database.ddev import-db --file=./some-non-prod-db-dump.sql.gz
.That certainly gets the job done, but on projects with database dump sizes in the gigabytes, it takes a very long time to actually refresh one’s dev environment. It would be really useful to be able to pass an option to the
dev:refresh
command which, when present, makes Robo skip the prod database download altogether and use the provided dump instead.Issue Owner
Acceptance Criteria
dev:refresh
command that accepts a local path to a database dump file.--db=./path-to-dump.sql.gz
dev:refresh
skips the database download step and imports the provided database dump instead.Alternatives Considered
n/a
Additional Context
Requested in our
#devops
channel.