Skip to content

cwp db export

shipped 1.0.0
cwp db export [file] [flags]

Local only — it acts on no environment.

ArgumentWhat it isDefault
[file]target file (default: -.sql.gz)

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

What it does

Runs ddev export-db, writing the local database to a file. With no filename the default is <project>-<timestamp>.sql.gz in the current directory.

Example

cwp db export
cwp db export handover.sql.gz

What it does not do

It exports the local database, not a remote one, and not the uploads.

An exported dump is an unscrubbed copy of whatever is local. If it came down from production and you skipped the scrub, personal data is in that file. cwp says so after every export, and the scaffolded .gitignore keeps *.sql and *.sql.gz out of the repository — but the file is still on your disk and still yours to handle.