Database backup restore

From aj-geddes/useful-ai-prompts · View interactive version

Database backup restore is an AI agent skill from the GitHub repository aj-geddes/useful-ai-prompts. Implement backup and restore strategies for disaster recovery. Use when creating backup plans, testing restore procedures, or setting up automated backups.

How to use this skill

Skill file

Database Backup & Restore

Table of Contents

Overview

Implement comprehensive backup and disaster recovery strategies. Covers backup types, retention policies, restore testing, and recovery time objectives (RTO/RPO).

When to Use

Quick Start

pg_dump - Text Format:

# 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 | Full Database Backup |

| Incremental & Differential Backups | Incremental & Differential Backups |

| Full Database Backup | Full Database Backup |

| Binary Log Backups | Binary Log Backups |

| PostgreSQL Restore | PostgreSQL Restore |

| MySQL Restore | MySQL Restore |

Best Practices

✅ DO

❌ DON'T

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.