Skip to content

Introduction

ddev-sync pulls a project’s production database, files and setup commands into a local DDEV environment, and leaves the production data behind while doing it. It is a DDEV add-on, and you drive it with ddev sync.

One command replaces the sequence every developer otherwise repeats by hand: dump the remote database over SSH, import it, rsync the uploads, point the local environment file at the local database, anonymise what came across, and run the framework’s own post-import commands.

Which commands those are depends on the project type. ddev-sync ships a profile for each of TYPO3 (9 through 13), Laravel, Symfony, WordPress, Drupal and Shopware 6, so it knows that TYPO3 wants vendor/bin/typo3 cache:flush where Laravel wants php artisan optimize:clear. Projects of any other DDEV type fall back to a generic profile. It syncs the database only, with credentials you enter yourself. No file paths are synced and no sanitize rule runs until you configure them, so production data arrives unanonymised. Configuring your own rules is covered in Sanitizing.

Optional features add work on top of a profile when they detect something in the project: a frontend build when package.json has a build script, or Horizon’s queue handling on a Laravel project that uses it. They are listed in Syncing.

ddev-sync never writes to the production host. It runs mysqldump and reads files with rsync; it pushes nothing, ever. All the writing happens in your local DDEV project.

A sync is an ordered list of steps. You can run all of them or pick groups:

StepWhat happens
preflightChecks that the remote is reachable and the credentials work. Always runs.
dbStreams a mysqldump over SSH, drops and recreates the local database, imports the dump.
envRewrites the local environment file so the project talks to the local database. Part of the db group.
filesRuns rsync for the paths the profile declares: uploads, fileadmin, storage/app/public.
s3Copies between two S3 endpoints, for projects that keep media in a bucket.
sanitizeTruncates sessions and queues, anonymises user tables, resets passwords and creates a local admin.
setupRuns the framework’s own commands: composer install, migrations, cache rebuilds.

The order is fixed: preflight, db, env, files, s3, sanitize, setup. --steps limits a run to some of the groups db, files, s3, sanitize and setup.

A production database on a laptop is the problem ddev-sync exists to solve, not a side effect it tolerates. The sanitize step empties session and queue tables, rewrites user email addresses to unreachable ones, replaces password hashes with a value nothing can authenticate against, and creates a local administrator you can log in with.

Those rules are declared per project type, and a rule that has never been run against a real installation can silently do nothing: a table that does not exist under that name, or a command that was never a command. Frameworks says which profiles have been exercised against a real installation and which have not.

Every change runs the engine’s own test suite, an integration suite that drives real containers over real SSH, and a verification matrix of eleven cells. Each cell installs a real framework and syncs it end to end: TYPO3 12 and 13, Laravel, Symfony, Drupal and WordPress, four more cells that switch features on, and one that syncs a Laravel through a Docker endpoint. Shopware has a profile but no cell, so none of its commands has been run.

The matrix and the integration suite sync against stand-ins that the project builds, which is not the same thing as your server. The add-on itself has been exercised on macOS with Docker Desktop and DDEV v1.25.4.

The sync runs in DDEV’s own containers and reaches the remote over the SSH agent DDEV already runs, with the keys ddev auth ssh loads into it. There is no account to create and no telemetry.

ddev-sync runs in Docker beside your project, so there is nothing to install on your machine besides the add-on.

  • noixdev/ddev-sync is the engine. The add-on starts it as a sync service next to your web and database containers, and ddev sync runs inside it. It carries SSH, rsync, the MariaDB client and rclone.
  • noixdev/ddev-sync-endpoint is the far side of the optional Docker provider, for production hosts that run in Docker themselves. You only need it if your target is set up that way.

Both images have versioned tags only and no latest; the Docker images reference lists them. The add-on names the engine version it was released with, so you never choose a tag by hand unless you are building a local image.

  1. Installation: add the add-on to a project.
  2. Your first sync: create a target, check it, run it.
  3. Updating: move to a newer version.

When you need an exact key, option or error, the reference has it: configuration, command line, troubleshooting, security and Docker images.