DEV Community

Cover image for Seven DDEV workflow wins, and what a rollback actually restores
Aleksandr Argunov
Aleksandr Argunov

Posted on Originally published at argbe.tech AI-assisted

Seven DDEV workflow wins, and what a rollback actually restores

I originally used Trellis, Bedrock and Sage for WordPress development. I set up a Docker Compose environment without Vagrant, and it was a little cumbersome. Now I'm using DDEV, and I love how much of the local environment it manages.

DDEV runs the local environment. Bedrock manages project layout and dependencies. Sage or a block theme decides how pages are built. Trellis handles infrastructure and deployment, and also offers local development with Lima. These tools can be combined.

The commands and settings, with their limits

These landed across DDEV 1.25.4 (September 2) and 1.25.5 (October 26). That's 54 days apart: 28 left in September, then 26 in October. The gap isn't how long the work took, since DDEV says 1.25.5 shipped early for PHP security fixes.

The start and restart flags were checked against --help on DDEV 1.25.5. They weren't run against a live project. These are separate examples, not a script to run in order.

# Fill a brand-new database volume from a snapshot (name or path required).
# Database type and version must match. This does not replace an existing database.
ddev start --seed-snapshot=mysnapshot

# Throw the database away and start over.
# Takes a snapshot first unless you add --omit-snapshot. Asks first unless you add -y.
ddev start --reset-database

# Restart only the services you name. A service name is required.
ddev restart -s redis

# Open the rebuilt TUI.
ddev tui

# Use your own SSH agent in the containers. Support depends on your Docker provider.
ddev config global --ssh-agent-upstream=host

# Share through a configured tunnel provider; the output includes a QR code.
ddev share
Enter fullscreen mode Exit fullscreen mode

Restarting web restarts the whole project, including optional services that were started; see the command reference.

Global hooks live in ~/.ddev/global_config.yaml. They run before a project's own hooks:

hooks:
  post-start:
    - exec-host: 'echo a global hook ran'
Enter fullscreen mode Exit fullscreen mode

A project opts out with skip_global_hooks: true.

What each tool restores

I still like Bedrock's Composer approach a lot. Plugins are listed in composer.json, and the lock file pins their versions. DDEV has Composer built in:

ddev composer install
Enter fullscreen mode Exit fullscreen mode

With the same committed lock file, that installs the same dependency versions. It doesn't reproduce the database or uploads.

You want back What restores it What it leaves alone
Composer-managed plugins composer.lock and composer install Plugins added or updated by hand, database, content
Your local database A DDEV snapshot Your code, and anything on a server
A deployed code release Trellis release and rollback Database and content changes

The theme decides the Site Editor

The Site Editor follows the theme type, not DDEV or Trellis.

  • A native block theme uses HTML templates and theme.json, and gives you the Site Editor.
  • Custom blocks can use React, scaffolded as a plugin with npx @wordpress/create-block.
  • Sage gives you Blade, Acorn, Vite and Tailwind, with HMR that includes editor styles. It isn't a full Site Editor block theme by default.

For deployment, Trellis provisions with Ansible and deploys with releases and rollback. Otherwise use your host's workflow, because DDEV hosting is still experimental.

Native WordPress keeps getting stronger. DDEV makes working with it a pleasure again.

The maintained version, with the full comparison table, is on argbe.tech.

Top comments (0)