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-tool-backup-project.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 in the dev folder; this folder's command carried the same two lines (the dev folder: webship/workspace-dev#16).

  • 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

The same two lines as the dev folder's command, proved there on a real Astro site in round 4: webship/workspace-dev#16 (the published command left a 0-byte dump and an export error; the fixed one says the site runs without a database and leaves the archive only). This folder's command is the same text, held by the same three unit tests.

@Natshah
Natshah merged commit a0b7f71 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