Skip to content

fix: #15 Back up this project leaves out the database of a site that has none, and no empty dump behind - #16

Merged
Natshah merged 1 commit into
1.0.xfrom
fix/15-backup-without-database
Nov 16, 2026
Merged

Natshah merged 1 commit into
1.0.xfrom
fix/15-backup-without-database

Conversation

@Natshah

@Natshah Natshah commented Nov 16, 2026

Copy link
Copy Markdown
Member

Closes #15

commands/cmd-tools-backup-dev.sh archived the project and then always ran ddev export-db. On a site that runs without a database (Astro, Gatsby: omit_containers: [db]) DDEV answered service db does not exist with the whole help of export-db, and left a …-db.sql.gz of 0 bytes beside the archive, which a restore then tried to import (webship/workspace#354). Seen in round 4 of the testing rounds on an Astro and a Gatsby site built from the dashboard.

  • A project whose .ddev/config.yaml (or a config.*.yaml beside it) omits db has its files backed up and the line <site> runs without a database: its files are backed up, and there is no database to export.; no export is tried, exit 0.
  • When ddev export-db fails, the empty dump it left is removed and the backup says The database of <site> could not be exported: only its files are backed up. (exit 1, as before).
  • A project with a database: unchanged, the dump is written beside the archive.

tests/backup.test.ts: three tests that run the command with a stand-in bootstrap and a ddev that does what DDEV does on export (an empty file first). Two of them fail on the old command (no database; failed export), the third holds the unchanged path. npm run lint clean; npm test: 16 pass, 0 fail.

Checkpoints

  • File an issue about this project
  • Addition/Change/Update/Fix to this project
  • Testing to ensure no regression
  • Automated unit/functional testing coverage
  • Developer Documentation support on feature change/addition
  • User Guide Documentation support on feature change/addition
  • UX/UI designer responsibilities
  • Accessibility and Readability
  • Reviewed by a human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Update Release Notes
  • Release

🤖 Generated with Claude Code

…has none, and no empty dump behind

AI-Generated: Yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Natshah

Natshah commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Proved in round 4 of the testing rounds on a real Astro site (@webship.co/workspace-astro 1.0.10, base 1.0.16), from the dashboard's DDEV → Back up this project.

Published 1.0.9 command:

Backed up r4-astro to …/backups/dev/dev---r4-astro--2026-11-16_18-23-37.tar.gz.
Error: failed to export database for r4-astro: unable to export db: service db does not exist in project r4-astro (state=doesnotexist)

and backups/dev/ held a …-db.sql.gz of 0 bytes beside the 40 MB archive.

This branch's command in place:

Backed up r4-astro to …/backups/dev/dev---r4-astro--2026-11-16_18-25-35.tar.gz.
r4-astro runs without a database: its files are backed up, and there is no database to export.

and only the archive. That backup, restored after the site was removed (with webship/workspace#355): Successfully started r4-astro, the site answered 200.

@Natshah
Natshah merged commit c798015 into 1.0.x Nov 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Back up this project on a site with no database prints an export error and leaves an empty dump beside the archive

1 participant