cwp db snapshot
shipped 1.0.0cwp db snapshot [name] [flags]
Local only: it acts on no environment.
| Argument | What it is | Default |
|---|---|---|
[name] | snapshot name (default: a timestamp) |
| Flag | What it does | Default |
|---|---|---|
--with-agent | with —dry-run on a host with no shell: install and remove the PHP agent so the plan is real | off |
Plus the shared flags --json, -v, --verbose, -q, --quiet and --dry-run.
What it does
cwp db snapshot runs ddev snapshot --name <name> against the local
database. With no name, the name is a timestamp: 20260728-113000.
cwp pull takes one of these before every import, named
pre-pull-<env>-<timestamp>. The ordinary reason to run this by hand is an
experiment you might want to walk back.
Example
cwp db snapshot before-migration
cwp db snapshot # timestamped
What it does not do
Uploads are not included. A snapshot is the database, so restoring one brings back your layouts, your options and your posts, not your media library.
Snapshots accumulate. cwp prunes nothing for you; cwp db list and
cwp db rm are the answer.