YugabyteDB Backup

How to backup and restore your YugabyteDB database for Curio

Maintaining regular backups of your YugabyteDB database is critical for disaster recovery and before performing operations like software downgrades. This guide covers essential backup and restore procedures for your Curio cluster's database.

triangle-exclamation

Important: Curio uses a DB and a schema

Curio connects to YugabyteDB over YSQL (Postgres protocol). Two configuration values matter:

  • Database name (CURIO_DB_NAME / --db-name) – default is yugabyte

  • Schema inside that database – Curio uses schema curio by default

So, on a default setup, you typically want to back up the yugabyte database (and it will include the curio schema).

Before running backups, confirm what Curio is configured to use:

# If you run Curio with env vars
echo "$CURIO_DB_NAME"

# If Curio is installed on PATH, you can inspect flags/defaults
curio --help | grep -E "db-(name|host|port)"

If you’re running Curio via systemd or containers, check the env/flags there:

# systemd (example)
systemctl cat curio | sed -n '1,200p'

# docker compose (example)
docker compose config | sed -n '1,200p'

Prerequisites

  • Access to your YugabyteDB cluster

  • The ysql_dump and ysqlsh utilities (included with YugabyteDB installation)

  • Sufficient disk space for backup files

Backup Methods

The ysql_dump utility creates a logical backup of your database that can be restored to any YugabyteDB cluster.

Full database backup

Parameters:

  • -h: YugabyteDB host address

  • -p: YSQL port (default: 5433)

  • -U: Database username

  • -d: Database name (often yugabyte for Curio defaults)

  • -F c: Custom format (compressed, supports parallel restore)

  • -f: Output filename

Example with typical Curio defaults

Curio schema backup

If you want to back up only Curio’s schema (and its data), not other schemas in the DB:

If you want schema-only (DDL only) for Curio (no data):

Method 2: Using ysqlsh with COPY

For smaller exports or specific tables:

Restore Procedures

Restore from ysql_dump backup

circle-exclamation

Full restore (entire database)

Restore only the Curio schema

If you created a Curio-schema dump (--schema=curio), restore into the existing DB:

If you created a Curio schema-only SQL file (--schema-only), apply it with ysqlsh:

Automated Backup Script (example)

Best Practices

  1. Regular backups: schedule automated daily backups for production clusters

  2. Test restores: periodically verify backups by performing test restores

  3. Off-site storage: store backup copies in a different location or cloud storage

  4. Pre-upgrade backups: always create a fresh backup before upgrading or downgrading Curio

  5. Monitor backup size: ensure adequate storage capacity

Troubleshooting

Connection issues

Permission errors

Ensure your database user has sufficient privileges:

You may also need privileges on the curio schema and its objects depending on how your cluster is secured.

Additional Resources


Multi-node cluster caveats (practical ops notes)

If you run a multi-node Yugabyte cluster:

  • Validate that your backup method matches your recovery goal.

    • Logical dumps (ysql_dump) are typically easiest for portability.

    • If you rely on Yugabyte-native distributed backups/snapshots, ensure you test restores.

Before a restore/downgrade:

  • stop all Curio writers

  • confirm no nodes are still writing tasks/metrics

See also:

  • documentation/en/administration/yugabyte-troubleshooting.md

Last updated