What can be imported
agent-local localwp-sites # LocalWP sites available
agent-local ddev-projects # DDEV projects available
agent-local import SOURCE # name or docroot pathA stopped LocalWP site or DDEV project is started first so its database can be read — LocalWP through its own control API, DDEV through ddev start. With Docker down, ddev-projects still lists names and roots from DDEV's registry.
Where the data comes from
# 1. Live DB, credentials read from the site's own wp-config.php (default)
agent-local import /path/to/dir
# 2. Explicit source DB
agent-local import /path/to/dir --db-host 127.0.0.1 --db-port 8889 \
--db-user root --db-pass secret --db-name mydb
# 3. From a dump instead of a live server
agent-local import /path/to/dir --sql ~/Downloads/site.sql
# 4. Leave the database alone entirely and just serve the files
agent-local import /path/to/dir --serve-onlyThe pipeline
- locate the source database (registry socket, DDEV's published port,
wp-config.php, or your flags) - stream
dump → collation fixer → load— flat memory for multi-GB dumps; MySQL-8 collations are rewritten to MariaDB ones on the way through - point
wp-config.phpat the new database, adding any defines it was missing (original kept aswp-config.php.agent-local.bak) search-replaceevery domain the database actually stores — staging subdomains included — then flush and serve
DDEV projects
A DDEV source is moved out of DDEV once it serves here: ddev delete removes the containers and the database volume, DDEV's own snapshot (kept in .ddev/db_snapshots/) is the way back, and your files plus .ddev/ are never touched.
agent-local import ddevsite # move it out of DDEV (default)
agent-local import ddevsite --keep-ddev # leave it registered in DDEV--keep-ddev leaves the project in place, but one docroot can point at only one database: its wp-config now points here, so restore the .bak (or ddev snapshot restore) to serve it from DDEV again.
Media fallback
Imports do not copy uploads. Point missing uploads at the production origin and any missing file redirects there: agent-local media SLUG --auto adopts the rule already in the site's .htaccess. The path watched is the site's own uploads URL — a WordPress site that moved its content dir (Bedrock's CONTENT_DIR=/app, or UPLOADS) is covered — not a fixed /wp-content/uploads/.