Skip to content

cwp db snapshot

shipped 1.0.0
cwp db snapshot [name] [flags]

Local only: it acts on no environment.

ArgumentWhat it isDefault
[name]snapshot name (default: a timestamp)
FlagWhat it doesDefault
--with-agentwith —dry-run on a host with no shell: install and remove the PHP agent so the plan is realoff

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.