database-backup-restore — Claude Code skill for DB backup and restore
A coding assistant skill for backup and disaster recovery strategies. Use it when planning backups, testing restore procedures, or setting up automated backup jobs.
npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a claude-codeWhat database-backup-restore does
The skill covers backup types, retention policies, restore testing, and RTO/RPO targets. Quick start examples show pg_dump commands for PostgreSQL: a plain text full dump, a compressed variant piped through gzip, verbose output logging, and excluding tables with --exclude-table=temp_*.
Reference guides in the references/ directory walk through full, incremental, and differential backups, binary log backups, and restore procedures for PostgreSQL and MySQL. The best practices section keeps it simple: follow existing patterns, test before deploying, handle errors, and avoid hard-coding configuration values.
Install it with npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a claude-code, and the skill lands at ~/.claude/skills/database-backup-restore/SKILL.md. It also works in Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode, each with its own install command and file path.
What it helps with
- Set up automated PostgreSQL backups
- Define a backup retention policy
- Test restore from a backup
- Plan point-in-time recovery
- Replicate backups across regions
Example prompts for the agent
- Create a backup plan for PostgreSQL: backup types, schedule, retention
- Show pg_dump commands for a full dump excluding temp tables
- Walk me through testing a MySQL restore procedure
How to install database-backup-restore
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a claude-code2Manually: put the files in place
~/.claude/skills/database-backup-restore/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/database-backup-restore/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a codex2Manually: put the files in place
.agents/skills/database-backup-restore/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a cursor2Manually: put the files in place
.cursor/skills/database-backup-restore/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts database-backup-restore2Manually: put the files in place
.github/skills/database-backup-restore/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/database-backup-restoreManually: put the files in place
.devin/skills/database-backup-restore/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about database-backup-restore
How do I install database-backup-restore in Claude Code?
Run npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a claude-code. The skill is then placed at ~/.claude/skills/database-backup-restore/SKILL.md.
What does this skill do?
It helps build backup and restore strategies: backup types, retention policies, restore testing, RTO/RPO, point-in-time recovery, and cross-region replication.
Which databases have restore examples?
The reference guides include restore procedures for PostgreSQL and MySQL, plus binary log backups. There are no examples for other database engines in the skill.
Source text
SKILL.md · MIT
--- name: database-backup-restore description: > Implement backup and restore strategies for disaster recovery. Use when creating backup plans, testing restore procedures, or setting up automated backups. --- # Database Backup & Restore ## Table of Contents - [Overview](#overview) - [When to Use](#when-to-use) - [Quick Start](#quick-start) - [Reference Guides](#reference-guides) - [Best Practices](#best-practices) ## Overview Implement comprehensive backup and disaster recovery strategies. Covers backup types, retention policies, restore testing, and recovery time objectives (RTO/RPO). ## When to Use - Backup automation setup - Disaster recovery planning - Recovery testing procedures - Backup retention policies - Point-in-time recovery (PITR) - Cross-region backup replication - Compliance and audit requirements ## Quick Start **pg_dump - Text Format:** ```bash # Simple full backup pg_dump -h localhost -U postgres -F p database_name > backup.sql # With compression pg_dump -h localhost -U postgres -F p database_name | gzip > backup.sql.gz # Backup with verbose output pg_dump -h localhost -U postgres -F p -v database_name > backup.sql 2>&1 # Exclude specific tables pg_dump -h localhost -U postgres database_name \ --exclude-table=temp_* --exclude-table=logs > backup.sql ``` ## Reference Guides Detailed implementations in the `references/` directory: | Guide | Contents | |---|---| | [Full Database Backup](references/full-database-backup.md) | Full Database Backup | | [Incremental & Differential Backups](references/incremental-differential-backups.md) | Incremental & Differential Backups | | [Full Database Backup](references/full-database-backup-2.md) | Full Database Backup | | [Binary Log Backups](references/binary-log-backups.md) | Binary Log Backups | | [PostgreSQL Restore](references/postgresql-restore.md) | PostgreSQL Restore | | [MySQL Restore](references/mysql-restore.md) | MySQL Restore | ## Best Practices ### ✅ DO - Follow established patterns and conventions - Write clean, maintainable code - Add appropriate documentation - Test thoroughly before deploying ### ❌ DON'T - Skip testing or validation - Ignore error handling - Hard-code configuration values
© aj-geddes · MIT · aj-geddes/useful-ai-prompts