[Scripts] Add safety safeguards to db-restore.sh
Overview & Background
scripts/db-restore.sh performs a destructive database restore with no safety rails: the "empty database" precondition (lines 6, 33) is never verified, the restore is not transactional, and there is no confirmation or dry-run mode. Restoring over a non-empty DB fails mid-dump, leaving partial state. For a payment-streaming service, a partial restore can corrupt financial records.
Technical Specification & Architecture
- Verify the target database is actually empty before restoring (or require an explicit
--forcewith confirmation). - Add a dry-run flag and a pre-restore snapshot step.
- Wrap the restore so failure leaves a known state (or clearly signals manual recovery).
Target Files
scripts/db-restore.shdocs/DISASTER_RECOVERY.md
Acceptance Criteria
- [ ] Non-empty target DBs are refused without
--force. - [ ] A dry-run mode reports what would happen.
- [ ] Failure mid-restore leaves documented, recoverable state.
- [ ] Disaster recovery docs match the script's actual behavior.
@pheelztech has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
i would love to work on this issue
âšī¸ Repo Maintainers: To accept this application, review their application or assign @pheelztech to this issue.
Congratulations, @pheelztech! đ Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
đ§âđģ @pheelztech: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
đ¤ Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
đ Happy Wave đ
This issue has been completed by @pheelztech as part of the Stellar Wave Program's 11th Wave đĨŗ
đ @pheelztech: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
đ§âđģ Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.