Skip to content

cwp db import

shipped 1.0.0
cwp db import <file> [flags]

Local only — it acts on no environment.

ArgumentWhat it isDefault
<file>SQL dump to import
FlagWhat it doesDefault
--yesskip the confirmation promptoff

Plus the shared flags --json, --verbose and --dry-run.

What it does

Runs ddev import-db, replacing the local database with a SQL dump.

It confirms first, because the local database is replaced; --yes skips the prompt. With --json or no terminal it refuses with exit 6 rather than guessing.

A dump that arrived any way other than cwp pull has not been scrubbed and carries no mail guard. Run cwp scrub after importing one.

Example

cwp db import handover.sql.gz
cwp db import dump.sql --yes

What it does not do

It does not scrub, install the mail guard, run search-replace, or snapshot what it is replacing. Those belong to cwp pull, which is the command that knows where the data came from; this one takes a file and does what it is told.

Uploads are not included.