postgres-backup

Back up and restore PostgreSQL databases with pg_dump and Borg.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/pkoka888/server-infra-templates --skill postgres-backup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-backup
Source: https://github.com/pkoka888/server-infra-templates/tree/main/.kilo/skills/postgres-backup
Command: npx skills add https://github.com/pkoka888/server-infra-templates --skill postgres-backup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protects Metabase PostgreSQL data by providing consistent backup and restore procedures, reducing the risk of data loss from container failures, accidental deletions, or configuration mistakes. It standardizes dump formats, verification steps, and offsite storage so teams can recover quickly and confidently.

Core Features & Use Cases

  • Full database dumps: Create consistent, compressed dumps of the entire metabase database using pg_dump inside the metabase-db container.
  • Table-specific exports: Export individual tables such as report_dashboard for targeted snapshots or migrations.
  • Restore workflows: Restore dumps to the same or different databases and run non-destructive test restores to validate integrity.
  • Scheduled and offsite backups: Integrate with Borg for versioned, passphrase-protected remote backups and automated retention.
  • Verification and troubleshooting: Verify dump integrity, list dump contents, and provide common checks for connection and permissions issues.

Quick Start

Create a compressed pg_dump of the metabase database inside the metabase-db container, copy it to /var/backups on the host, and verify it can be restored to a test database.

Frequently Asked Questions about postgres-backup

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

FAQPage Schema
How do I backup a PostgreSQL database running in a Docker container?

To backup a PostgreSQL database in Docker, run pg_dump inside the container to create a compressed dump, then copy the file to the host. This Skill standardizes containerized pg_dump workflows and verifies dump integrity.

Can I use Borg for scheduled offsite PostgreSQL backups?

Yes, you can integrate Borg for scheduled offsite PostgreSQL backups. This Skill configures versioned, passphrase-protected remote repositories with automated retention to ensure consistent offsite storage.

How do I restore a pg_dump to a test PostgreSQL database without affecting production?

You can restore a pg_dump to a test PostgreSQL database non-destructively. This Skill provides ad-hoc restore workflows to validate dump integrity and safely migrate data to test or production databases.

Is it possible to export specific tables from a PostgreSQL database using pg_dump?

Yes, you can export specific tables from a PostgreSQL database using pg_dump. This Skill supports table-specific exports like report_dashboard for targeted snapshots and database migrations.

What is the best way to verify PostgreSQL dump integrity before restoring?

The best way to verify PostgreSQL dump integrity is to run a non-destructive test restore and list the dump contents. This Skill performs integrity verification and provides connection troubleshooting checks.

Does this backup process work with Metabase running in Docker?

Yes, this backup process works with Metabase running in Docker as metabase-db. This Skill specifically targets the metabase database for full database dumps, table exports, and restores.