Skip to content

fix: #354 Restore imports the dump beside the archive only when it is not empty, and says so when it is - #355

Merged
Natshah merged 2 commits into
1.0.xfrom
fix/354-restore-empty-dump
Nov 16, 2026
Merged

Natshah merged 2 commits into
1.0.xfrom
fix/354-restore-empty-dump

Conversation

@Natshah

@Natshah Natshah commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Closes #354

Backups → Restore took the …-db.sql.gz (or …-db.sql) beside the archive as soon as the file existed, and ran ddev import-db on it. A site that runs without a database (Astro, Gatsby: omit_containers: [db]) was backed up with a dump of 0 bytes (ddev export-db opens its file before it finds there is no database), so its restore ended with failed to extract provided file: EOF and the help of import-db, although every file was back and the site was up. Seen in round 4 of the testing rounds on a Gatsby site.

Proved in round 4 of the testing rounds on a real Astro site (@webship.co/workspace-astro 1.0.10, base 1.0.16 with this change put in place), from the dashboard: the published dev backup command left dev---r4-astro--…-db.sql.gz of 0 bytes beside a 40 MB archive; the site was removed; Restore printed dev---r4-astro--2026-11-16_18-23-37-db.sql.gz is empty: the project had no database to export when it was backed up, so there is none to import., Successfully started r4-astro, and the site answered 200. A backup from the fixed dev command (webship/workspace-dev#16: archive only), removed and restored: Successfully started r4-astro, 200.

tests/unit/restore-dump.test.js: 7 tests (a dump that has the database, a .sql, an empty one named and not imported, an empty .sql.gz that does not hide a .sql, no dump, the restore action using the helper, and a DDEV project with no dump started). Unit suite: 1414 tests, 1394 pass, 0 fail, 20 skipped.

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

… not empty, and says so when it is

AI-Generated: Yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… started, as one with a dump is

AI-Generated: Yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Natshah
Natshah force-pushed the fix/354-restore-empty-dump branch from 35e7eef to 821d31d Compare November 16, 2026 15:30
@Natshah
Natshah merged commit 29370b7 into 1.0.x Nov 16, 2026
1 check passed
@Natshah
Natshah deleted the fix/354-restore-empty-dump branch November 16, 2026 15:34
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.

Restore of a site with no database ends in an error: it imports the empty dump the backup left beside the archive

1 participant