Skip to content

Command line

ddev sync runs inside the add-on’s sync container. Its options belong to ddev sync itself, not to the subcommands.

DDEV splits arguments at spaces, so a value with a space in it, such as --target "a b", arrives as two words.

CommandWhat it does
ddev syncThe interactive sync: pick a target if there are several, tick the step groups, then run.
ddev sync initA wizard that writes one target into .ddev/ddev-sync.yaml and then runs doctor against it. Needs a terminal. See Your first sync.
ddev sync doctorProbes a target read-only and prints a checklist. Exits 0 only if every row passes.
ddev sync sshOpens a shell on a target’s host, with your SSH agent and without a password prompt. --target picks the target; without it you are asked if the project has more than one. On a provider: server target it starts in the data directory. Under provider: docker it goes to the Docker host and its home directory, not into the stack. Needs a terminal. The exit code is that of the shell.
ddev sync targetsLists every target from all layers with its endpoint and the file that defines it. A deployer: target is not resolved.
ddev sync buildRebuilds the frontend only. Shorthand for --steps=setup --features=node-build --only-feature-setup, and refused when combined with --steps, --features, --no-features or --only-feature-setup.
ddev sync help [COMMAND]The same as --help; ddev sync help doctor shows one command. A name that is not a command says so, then prints the full help.

doctor does not stop at the first failing row, so you always see all of them. A row whose probe cannot run is left out.

RowWhat it says
ssh connectionThe remote answers over SSH. Labelled sync endpoint for a Docker endpoint. When it fails, the row shows ssh’s own words.
deploy pathThe target’s path exists. For a Docker endpoint it reads (in the endpoint), because the path is read inside the container.
disk spaceThe free space on your own machine; it fails under 2 GB.
path readableThe path can be listed by the user the sync runs as. Under provider: docker this catches a wrong DDEV_SYNC_UID.
credentialsThe configured credential source really yields credentials. The row names the database a sync would dump, as source: user@host:port/name, and never the password. It appears for every project type, because a profile with no sanitize rules has no table to probe, and without this row such a project could pass doctor and still fail at the dump.
sanitize tablesEvery table a rule requires exists on the remote, and so does every column a fake rule names.
web containerThe sync container can reach your project’s web container, where framework commands run. The probe goes through the Docker socket, so an OK covers the socket too.
ssh agentThe sync container finds DDEV’s forwarded agent socket. It does not show that a key is loaded.

web container and ssh agent are the two rows that prove the installation. If both are OK, the add-on is wired up even when ssh connection fails. Without a reachable remote only ssh connection fails, and that says nothing about the installation. If it fails with the installation rows OK, the problem is the target, the key, or a remote host whose key has changed. A host ssh has never seen is not a problem: ddev-sync accepts it on first contact and remembers it. Each failing row links to its entry in Troubleshooting.

These apply to ddev sync and are given before any subcommand.

OptionDefaultMeaning
--target TEXTthe only target, otherwise a pickerWhich target to use. With none or several defined and no terminal, it is an error.
--steps TEXTthe pickerComma list from db, files, s3, sanitize, setup. Only groups the project has work for are accepted. preflight always runs. Wins over steps in the configuration.
--features TEXTdetectionComma list of features; replaces detection. A blank value is refused.
--no-featuresoffTurn feature detection off for this run. Cannot be combined with --features.
--only-feature-setupoffRun only the setup commands that features contribute.
--type TEXTdetectedForce the profile: typo3, laravel, wordpress, symfony, shopware6, drupal or generic.
--framework-version TEXTdetectedForce the framework’s major version.
--dry-runoffPrint the plan and run nothing. A deployer: target is still resolved, which evaluates deploy.php. Also validates the sanitize.disable_* switches.
--yesoffTake every default and skip prompts: it selects the configured default steps or, with none configured, all available step groups, and skips the “drop local database” and environment-diff confirmations.
-v, --verboseoffRepeatable. -v shows each step’s plan, -vv also command output, -vvv also each command line and step durations. Secrets are shown as ***, and output of commands that carry credentials is withheld.
--home PATHyour homeWhere the global layer .ddev/ddev-sync/config.yaml is read from. The ddev sync wrapper sets it.
--project-root PATH/var/www/htmlThe project mount in the sync container.
--profile-root PATH, --feature-root PATHthe shipped onesWhere profile and feature files are read from. For development.
--versionPrints the version.
-h, --helpPrints help.

init refuses --target, --steps, --features, --no-features, --only-feature-setup, --dry-run and --yes, because it asks for what it needs. --type and --framework-version are allowed.

The step picker pre-ticks db, files and sanitize; s3 and setup are offered when the project has work for them but are not ticked. See Syncing for the groups and their order.

Each step shows .. while running, then OK, FAIL or -- for skipped. After a failing step the later ones are skipped. Most errors end with a More: link to its entry in Troubleshooting.

CodeMeaning
0Success.
1A failed step, a failing doctor row, or any other error.
2A usage error, such as an unknown or misplaced option.
130Interrupted with Ctrl-C, at a prompt or while a step ran. The message says where it stopped, what state the local database is in and what to re-run, see Ctrl-C. Cancelling a picker with Ctrl-C, or interrupting while the configuration is read or the plan is built, also exits 130 and prints “Interrupted.”.

These are the engine’s own codes. ddev sync itself may report a non-zero code to your shell as 1, whatever the engine returned, and DDEV’s message then reads exit status 2 or similar. When you need to tell a wrong command line from a failed step, read that message rather than $?.

VariableEffect
NO_COLORAny non-empty value turns colour off.
FORCE_COLORAny non-empty value turns colour on; 0 turns it off.
TERM=dumbColour and the progress spinner are off.

Otherwise colour is on when the output is a terminal. There is no command-line option for colour.

Under the add-on, colour follows the terminal and nothing else: DDEV does not pass NO_COLOR or FORCE_COLOR from your own shell into the sync container, so setting them before ddev sync has no effect. They are honoured when the engine runs directly, for example from a checkout. doctor shows OK in green and FAIL in red only when its output goes to a terminal; piped into a file or another command it stays plain text.