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.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
ddev sync | The interactive sync: pick a target if there are several, tick the step groups, then run. |
ddev sync init | A 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 doctor | Probes a target read-only and prints a checklist. Exits 0 only if every row passes. |
ddev sync ssh | Opens 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 targets | Lists every target from all layers with its endpoint and the file that defines it. A deployer: target is not resolved. |
ddev sync build | Rebuilds 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. |
The doctor checklist
Section titled “The doctor checklist”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.
| Row | What it says |
|---|---|
ssh connection | The remote answers over SSH. Labelled sync endpoint for a Docker endpoint. When it fails, the row shows ssh’s own words. |
deploy path | The target’s path exists. For a Docker endpoint it reads (in the endpoint), because the path is read inside the container. |
disk space | The free space on your own machine; it fails under 2 GB. |
path readable | The path can be listed by the user the sync runs as. Under provider: docker this catches a wrong DDEV_SYNC_UID. |
credentials | The 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 tables | Every table a rule requires exists on the remote, and so does every column a fake rule names. |
web container | The 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 agent | The 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.
Options
Section titled “Options”These apply to ddev sync and are given before any subcommand.
| Option | Default | Meaning |
|---|---|---|
--target TEXT | the only target, otherwise a picker | Which target to use. With none or several defined and no terminal, it is an error. |
--steps TEXT | the picker | Comma 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 TEXT | detection | Comma list of features; replaces detection. A blank value is refused. |
--no-features | off | Turn feature detection off for this run. Cannot be combined with --features. |
--only-feature-setup | off | Run only the setup commands that features contribute. |
--type TEXT | detected | Force the profile: typo3, laravel, wordpress, symfony, shopware6, drupal or generic. |
--framework-version TEXT | detected | Force the framework’s major version. |
--dry-run | off | Print the plan and run nothing. A deployer: target is still resolved, which evaluates deploy.php. Also validates the sanitize.disable_* switches. |
--yes | off | Take 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, --verbose | off | Repeatable. -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 PATH | your home | Where the global layer .ddev/ddev-sync/config.yaml is read from. The ddev sync wrapper sets it. |
--project-root PATH | /var/www/html | The project mount in the sync container. |
--profile-root PATH, --feature-root PATH | the shipped ones | Where profile and feature files are read from. For development. |
--version | Prints the version. | |
-h, --help | Prints 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.
Output
Section titled “Output”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.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | Success. |
1 | A failed step, a failing doctor row, or any other error. |
2 | A usage error, such as an unknown or misplaced option. |
130 | Interrupted 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 $?.
Colour
Section titled “Colour”| Variable | Effect |
|---|---|
NO_COLOR | Any non-empty value turns colour off. |
FORCE_COLOR | Any non-empty value turns colour on; 0 turns it off. |
TERM=dumb | Colour 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.