database-copy

Copy PostgreSQL databases between environments with read-only dumps and verified restores.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/leandro-br-dev/charhub --skill database-copy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-copy
Source: https://github.com/leandro-br-dev/charhub/tree/main/docs/agents/skills/database-copy
Command: npx skills add https://github.com/leandro-br-dev/charhub --skill database-copy

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Safely copy databases between environments to restore data after tests, recover from data loss, or synchronize multiple deployments, while ensuring source read-only operations and data integrity.

Core Features & Use Cases

  • Read-only source dumps via network to destination databases.
  • Automatic verification by comparing row counts for core tables (User, Character, Story) before and after copy.
  • Stepwise safety flow: stop destination backend, create dump, restore, verify, restart, and optional cleanup.
  • Use cases include post-test resets, disaster recovery, environment bootstrapping, and cross-environment syncing.

Quick Start

Copy the database from a source environment to a destination environment using the db-copy-from-env script.

Frequently Asked Questions about database-copy

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

FAQPage Schema
How do I safely copy a PostgreSQL database between environments?

To safely copy a PostgreSQL database, you create a read-only dump from the source environment and perform a validated restore to the destination, automatically verifying row counts before and after the transfer.

What is the best way to sync data across multiple PostgreSQL deployments?

Syncing data across multiple PostgreSQL deployments involves stopping the destination backend, creating a network read-only dump, restoring the data, and verifying core table row counts before restarting the backend.

Do I need to stop the destination backend before restoring a database dump?

Yes, you must stop the destination backend before restoring a database dump to ensure data integrity, then verify users, characters, and stories before restarting the backend service.

Can I use pg_dump and psql to recover data after tests?

Yes, you can use pg_dump and psql to recover data after tests by creating a read-only source dump and performing a validated restore to reset the destination environment.

How does this database copy process verify data integrity?

Data integrity is verified by automatically comparing row counts for core tables, specifically User, Character, and Story, before and after the database copy operation completes.

When should I avoid using pg_dump for cross-environment database synchronization?

You should avoid using pg_dump for cross-environment synchronization if you cannot stop the destination backend during the restore process, as this step is required to maintain data integrity.