database-backup

Create database backups before tests, migrations, seeders, and destructive queries.

Updated Jan 7, 2026
One-click install
npx skills add https://github.com/Smooth-Operation/household-expense-tracker --skill database-backup-smooth-operation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-backup
Source: https://github.com/Smooth-Operation/household-expense-tracker/tree/main/.claude/skills/safety/database-backup
Command: npx skills add https://github.com/Smooth-Operation/household-expense-tracker --skill database-backup-smooth-operation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pg_dump, psql, and includes scripts (resource) components.

What problem does it solve?

Automatically create a database backup before operations that could modify or destroy data, preventing data loss and downtime.

Core Features & Use Cases

  • Automated backups prior to tests, migrations, seeders, and destructive queries.
  • Safe restore path with the latest backup if deployment or testing goes wrong.
  • Easy integration with CI/CD pipelines to enforce data safety policies.

Quick Start

Run a backup before an operation:

  • ./scripts/backup-database.sh
  • ./scripts/safe-test.sh npm test
  • ./scripts/safe-migrate.sh php artisan migrate
  • ./scripts/restore-database.sh --latest

Frequently Asked Questions about database-backup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate a database backup before running migrations and destructive queries?

Automate a database backup before migrations and destructive queries by running scripts like safe-migrate.sh, which creates a snapshot of your data before executing the operation to prevent data loss and downtime.

What is the best way to restore a database after a failed test or deployment?

The best way to restore a database after a failed test or deployment is to use a dedicated restore script, such as restore-database.sh --latest, which reverts your data to the most recent backup state.

Can I integrate automated database backups into a CI pipeline?

Yes, you can integrate automated database backups into a CI pipeline by calling the provided backup scripts as workflow steps, enforcing data safety policies before running tests or seeders.

Do I need pg_dump to run automated database backup scripts?

Yes, you need pg_dump and psql installed in your environment, as the automated database backup and restore scripts rely on these dependencies to create and recover snapshots.

How do I safely run seeders and tests without risking my staging database?

Safely run seeders and tests without risking your staging database by wrapping the commands with automated backup scripts like safe-test.sh, which secures a backup before modifying or destroying data.