Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aj-geddes/useful-ai-prompts --skill database-backup-restore -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/database-backup-restore/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/database-backup-restore/

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

Similar skills

All skills for Data and databases →

From the same set118

frontend-accessibility This skill adds WCAG guidelines to your coding workflow. It instructs agents to write semantic HTML, configure ARIA attributes, and support keyboard navigation. CX Codex +1 599installs design-patterns-implementation Guides the agent toward the right pattern for an architectural problem: Singleton, Factory, Observer, Strategy and more. Useful during refactoring or code review. CX Codex +1 595installs unit-testing-framework A skill that gives the agent rules for writing unit tests: Arrange-Act-Assert structure, mocks, edge cases. Useful when a function or class needs coverage. CX Codex +1 593installs database-query-optimization A skill that walks your agent through slow SQL: execution plans, indexes, and where the time actually goes. Useful when the database drags. CX Codex +1 586installs memory-leak-detection A skill for tracking down memory leaks: heap snapshots, profiling and the usual patterns behind growing memory use. CX Codex +1 580installs technical-roadmap-planning Builds a technical roadmap across quarters and years: architecture, infrastructure, stack investments. Useful before a big modernization push. CX Codex +1 577installs accessibility-testing A skill that walks your agent through WCAG checks: axe scans, keyboard navigation, ARIA, screen readers. Useful when a project has to meet a11y requirements. CX Codex +1 575installs push-notification-setup Integrates push notifications for iOS and Android using Firebase Cloud Messaging and APNs. Helps handle token refreshes, deep linking, and background sync. CX Codex +1 575installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor