Recovery Workflows
WPMoo is designed around recoverable local development.
Generated files can be refreshed. Source repositories are preserved. Database work has snapshot and dry-run paths.
If The Environment Feels Broken
Start with fast local status:
./moo statusThen run doctor:
./moo doctorApply safe file-level repairs only when the output says fixes are available:
./moo doctor --fixIf PostgreSQL is running and you want read-only database diagnostics:
./moo doctor --postgresBefore Risky Work
Create a snapshot:
./moo snapshot devel before-refactorList snapshots:
./moo snapshot --listPreview restore before changing data:
./moo restore-snapshot --dry-run before-refactor develRestore intentionally:
./moo restore-snapshot before-refactor develWhen Generated Files Drift
Preview a safe reset:
$ npx @wpmoo/toolkit reset --dry-run$ pnpm dlx @wpmoo/toolkit reset --dry-run$ yarn dlx @wpmoo/toolkit reset --dry-run$ bunx @wpmoo/toolkit reset --dry-runThen refresh generated files:
$ npx @wpmoo/toolkit reset$ pnpm dlx @wpmoo/toolkit reset$ yarn dlx @wpmoo/toolkit reset$ bunx @wpmoo/toolkit resetRun checks after reset:
./moo doctor
./moo statusSafe reset preserves:
.env- runtime database data
- filestore data
- backups
- source repositories under
odoo/custom/src - custom manifests
- custom patches
It can refresh:
.wpmoo/odoo.json./moo- generated docs
- Compose files
- helper scripts
- optional project-local Agent Skills
Common Recovery Playbooks
| Situation | First command | Next step |
|---|---|---|
| Cockpit disables module actions | ./moo status | Add/sync source repos or add a module. |
| Docker or database is not ready | ./moo doctor | Start Docker or restart services. |
| Source manifest looks stale | npx @wpmoo/toolkit source sync --dry-run | Run source sync if the preview is correct. |
| Generated files were edited or lost | npx @wpmoo/toolkit reset --dry-run | Run safe reset, then doctor. |
| Test failure is unclear | ./moo test my_module | Read the printed log excerpt and full log path. |
| Risky migration or refactor ahead | ./moo snapshot devel before-change | Run update/test, then restore preview if needed. |
Stage And Production Preview
In stage and production-like modes, prefer read-only or dry-run commands first:
WPMOO_ENV=prod ./moo status
WPMOO_ENV=prod ./moo doctor
WPMOO_ENV=prod ./moo doctor --postgres
WPMOO_ENV=prod ./moo restore-snapshot --dry-run before-change develLifecycle and destructive commands require explicit flags. See Quality Gates.
Troubleshooting
For specific failure states, open the Troubleshooting guide.
