Skip to main content
Zerops provides automated data backup for PostgreSQL services with full encryption and flexible management options. For general backup information including configuration, scheduling, and management options, see the Zerops Backups documentation, which covers:
  • Backup scheduling and retention policies
  • Tagging system and storage quotas
  • Manual backup creation and CLI tools
  • Security and encryption details
This page focuses on PostgreSQL-specific backup details.

PostgreSQL Backup Format

PostgreSQL backups are created using pg_dump and stored in .zip format:
  • Format: .zip (containing per-schema .dump files)
  • Tooling: pg_dump
  • Compression: Custom format (-Fc), schema files named schemaName.dump
  • Storage: Encrypted and stored in isolated object storage

Backup Configuration

You can configure backup settings in the Zerops GUI:
1

Navigate to Backup settings

Go to your PostgreSQL service and select Backups List & Configuration.
2

Configure schedule

Set up automated backup schedule:
  • Choose backup frequency (hourly, daily, weekly)
  • Set retention period
  • Configure backup window
3

Add tags (optional)

Create tags to organize and protect important backups:
  • Protected tags prevent automatic deletion
  • Use descriptive names like pre-migration-v2

Creating Manual Backups

You can create manual backups at any time:

Using Zerops GUI

1

Navigate to Backups

Go to your PostgreSQL service and select Backups List & Configuration.
2

Create backup

Click Create backup now button.
3

Add tag (optional)

Optionally add a tag to identify this backup (e.g., before-schema-change).

Using zCLI

# Create a backup with a tag
zcli service backup create --service-id <service-id> --tag "pre-migration"

# List all backups
zcli service backup list --service-id <service-id>

Restoring PostgreSQL Backups

To restore a PostgreSQL backup:
1

Download the backup file

Download the backup file (.zip) from the Zerops UI:
  1. Navigate to your PostgreSQL service
  2. Go to Backups List & Configuration
  3. Find the backup you want to restore
  4. Click the three dots menu (⋮)
  5. Select Download
2

Extract the backup

Extract the zip file to access the individual schema dump files:
unzip backup.zip
3

Prepare target environment

Choose one of the following:
  • Clean existing data in your database
  • Create a new PostgreSQL service for the restore
4

Restore using pg_restore

Use PostgreSQL native tools to restore the data:
# Restore a single schema
pg_restore -h hostname -U username -d database_name schemaName.dump

# Restore with verbose output
pg_restore -v -h hostname -U username -d database_name schemaName.dump

# Restore and clean existing data first
pg_restore -c -h hostname -U username -d database_name schemaName.dump
Use the -c flag to drop database objects before recreating them. Use -v for verbose output to monitor progress.

Alternative: Using Management Tools

You can also restore backups using web-based management tools like phpMyAdmin or AdminerEvo as described in PostgreSQL Management.

Restore Examples

# Connect via Zerops VPN first
zcli vpn start

# Restore to the database
pg_restore -h database1 -U database1 -d db -v schemaName.dump

# Stop VPN when done
zcli vpn stop
If you have dependencies between schemas, make sure to restore them in the correct order.

High Availability

For PostgreSQL services running in High Availability mode:
  • Backups are created on a randomly selected healthy node
  • Other nodes remain operational during the backup process
  • Manual backups typically run on the primary node

Best Practices

Before Major Changes

Always create a manual backup with a protected tag before database migrations or major schema changes.

Test Restores

Test your restore process periodically in a non-production environment.

Monitor Storage

Monitor your backup storage usage in the Project Overview.

Use Descriptive Tags

Use descriptive tags like pre-migration-v2 for important snapshots.

Additional Best Practices

  • Consider schema order - If you have dependencies between schemas, restore them in the correct order
  • Protect critical backups - Use protected tags to prevent automatic deletion of important backups
  • Schedule wisely - Configure backup schedules during low-traffic periods to minimize impact
  • Document your process - Keep notes on your backup and restore procedures
  • Verify backups - Periodically verify that backups are being created successfully

Troubleshooting

Backup fails with “out of disk space”

  • Increase the maxDisk setting in your PostgreSQL service scaling configuration
  • Clean up old backups to free storage quota
  • Check backup retention policies

Restore is very slow

  • The restore process speed depends on:
    • Database size
    • Available RAM and CPU resources
    • Network connection (for remote restores)
  • Consider temporarily scaling up your PostgreSQL service during restore

Restore fails with permission errors

  • Ensure you’re using a user with sufficient privileges
  • For full restores, use the superuser credentials (postgres user)
  • Check that the target database exists and is accessible

Next Steps

For assistance with the restoration process or backup configuration, contact Zerops support. For additional best practices and troubleshooting, refer to the main backup documentation.

Manage Users & Databases

Create and manage users, databases, and plugins

Connect to PostgreSQL

Learn connection methods for internal and remote access

Build docs developers (and LLMs) love