Database Backup
Piora uses each database’s native backup tools to ensure backup integrity and compatibility.
Supported Databases
Section titled “Supported Databases”| Database | Backup Tool | Backup Format |
|---|---|---|
| PostgreSQL | pg_dump | .sql / .dump |
| MySQL / MariaDB | mysqldump | .sql |
| MongoDB | mongodump | BSON binary |
PostgreSQL Backup
Section titled “PostgreSQL Backup”Configure Automatic Backup
Section titled “Configure Automatic Backup”- Go to your PostgreSQL database settings page
- Click the “Backup” tab
- Configure the backup schedule and storage location
- Click “Enable”
Backup Parameters
Section titled “Backup Parameters”| Parameter | Description | Recommended |
|---|---|---|
| Backup format | Plain SQL or custom format | Custom format (supports parallel restore) |
| Compression | Whether to compress backup files | Enabled |
| Schedule | Backup frequency | Daily |
| Retention | Number of backups to keep | 7 |
Manual Backup and Restore
Section titled “Manual Backup and Restore”# Manually trigger a backup (via dashboard terminal)pg_dump -U piora_admin -Fc myapp > /backup/myapp_$(date +%Y%m%d).dump
# Restore from backuppg_restore -U piora_admin -d myapp /backup/myapp_20240115.dumpMySQL / MariaDB Backup
Section titled “MySQL / MariaDB Backup”Configure Automatic Backup
Section titled “Configure Automatic Backup”- Go to your MySQL database settings page
- Click the “Backup” tab
- Configure parameters and schedule
- Enable automatic backup
Backup Commands
Section titled “Backup Commands”# Full backupmysqldump -u root -p --single-transaction --routines --triggers myapp > backup.sql
# Compressed backupmysqldump -u root -p --single-transaction myapp | gzip > backup.sql.gz
# Restoremysql -u root -p myapp < backup.sqlMongoDB Backup
Section titled “MongoDB Backup”Automatic Backup Configuration
Section titled “Automatic Backup Configuration”# Full backupmongodump --uri="mongodb://admin:password@mongodb:27017/myapp?authSource=admin" \ --out=/backup/mongodb_$(date +%Y%m%d)
# Compressed backupmongodump --uri="mongodb://admin:password@mongodb:27017/myapp?authSource=admin" \ --archive=/backup/myapp.archive --gzip
# Restoremongorestore --uri="mongodb://admin:password@mongodb:27017/myapp?authSource=admin" \ /backup/mongodb_20240115/myapp/Cloud Storage Backup
Section titled “Cloud Storage Backup”S3 Configuration
Section titled “S3 Configuration”Piora uses RClone to upload backups to cloud storage:
- In the dashboard, go to “Backup Settings” and add a storage destination
- Select the storage type (S3, R2, GCS, etc.)
- Enter the authentication details:
| Parameter | Description |
|---|---|
| Endpoint | S3 endpoint URL |
| Access Key | Access key |
| Secret Key | Secret key |
| Bucket | Storage bucket name |
| Region | Region (e.g., us-east-1) |
Backup Encryption
Section titled “Backup Encryption”To protect the security of your backup data, you can enable backup encryption:
- Backup files are encrypted with AES-256 before upload
- The encryption key is set and managed by you
- The correct encryption key is required for restoration
Monitoring Backup Status
Section titled “Monitoring Backup Status”The dashboard shows:
- Recent backup records and statuses
- Backup file sizes
- Backup duration
- Failed backups and error messages