{"slug":"databases-backups","title":"Database Backups","description":"DanubeData provides automatic daily backups for all managed databases with easy point-in-time restoration. This guide covers backup management, restoration procedures, and best practices for disaster...","section":"Features","url":"https://docs.danubedata.ro/databases-backups","markdown_url":"https://docs.danubedata.ro/databases-backups.md","breadcrumbs":[{"title":"Features","slug":null},{"title":"Databases","slug":"databases-overview"},{"title":"Backups","slug":"databases-backups"}],"headings":[{"level":1,"title":"Database Backups","id":"database-backups"},{"level":2,"title":"Overview","id":"overview"},{"level":2,"title":"Automatic Backups","id":"automatic-backups"},{"level":3,"title":"Default Backup Schedule","id":"default-backup-schedule"},{"level":3,"title":"Backup Process","id":"backup-process"},{"level":3,"title":"What's Included in Backups","id":"whats-included-in-backups"},{"level":2,"title":"Backup Configuration","id":"backup-configuration"},{"level":3,"title":"Adjusting Backup Schedule","id":"adjusting-backup-schedule"},{"level":3,"title":"Retention Period","id":"retention-period"},{"level":2,"title":"Manual Backups","id":"manual-backups"},{"level":3,"title":"Creating On-Demand Backups","id":"creating-on-demand-backups"},{"level":3,"title":"When to Create Manual Backups","id":"when-to-create-manual-backups"},{"level":3,"title":"Manual Backup Retention","id":"manual-backup-retention"},{"level":2,"title":"Restoring from Backups","id":"restoring-from-backups"},{"level":3,"title":"Restore Options","id":"restore-options"},{"level":4,"title":"1. Restore to Existing Database","id":"1-restore-to-existing-database"},{"level":4,"title":"2. Restore to New Database","id":"2-restore-to-new-database"},{"level":3,"title":"Restoration Process","id":"restoration-process"},{"level":4,"title":"Restore to Existing Database","id":"restore-to-existing-database"},{"level":4,"title":"Restore to New Database","id":"restore-to-new-database"},{"level":3,"title":"Point-in-Time Recovery","id":"point-in-time-recovery"},{"level":4,"title":"Using Point-in-Time Recovery","id":"using-point-in-time-recovery"},{"level":2,"title":"Backup Verification","id":"backup-verification"},{"level":3,"title":"Testing Backups","id":"testing-backups"},{"level":3,"title":"Backup Integrity","id":"backup-integrity"},{"level":2,"title":"External Backups","id":"external-backups"},{"level":3,"title":"PostgreSQL Export","id":"postgresql-export"},{"level":4,"title":"Using pgdump","id":"using-pgdump"},{"level":4,"title":"Import PostgreSQL Backup","id":"import-postgresql-backup"},{"level":3,"title":"MySQL/MariaDB Export","id":"mysqlmariadb-export"},{"level":4,"title":"Using mysqldump","id":"using-mysqldump"},{"level":4,"title":"Import MySQL/MariaDB Backup","id":"import-mysqlmariadb-backup"},{"level":3,"title":"Automated External Backups","id":"automated-external-backups"},{"level":2,"title":"Backup Storage","id":"backup-storage"},{"level":3,"title":"Storage Location","id":"storage-location"},{"level":3,"title":"Storage Costs","id":"storage-costs"},{"level":3,"title":"Backup Size","id":"backup-size"},{"level":2,"title":"Disaster Recovery Planning","id":"disaster-recovery-planning"},{"level":3,"title":"Recovery Time Objective (RTO)","id":"recovery-time-objective-rto"},{"level":3,"title":"Recovery Point Objective (RPO)","id":"recovery-point-objective-rpo"},{"level":3,"title":"Disaster Recovery Checklist","id":"disaster-recovery-checklist"},{"level":4,"title":"Before Disaster","id":"before-disaster"},{"level":4,"title":"During Disaster","id":"during-disaster"},{"level":4,"title":"After Disaster","id":"after-disaster"},{"level":2,"title":"Best Practices","id":"best-practices"},{"level":3,"title":"Backup Strategy","id":"backup-strategy"},{"level":3,"title":"Application Best Practices","id":"application-best-practices"},{"level":3,"title":"Security Best Practices","id":"security-best-practices"},{"level":2,"title":"Monitoring and Alerts","id":"monitoring-and-alerts"},{"level":3,"title":"Backup Monitoring","id":"backup-monitoring"},{"level":3,"title":"Alert Configuration","id":"alert-configuration"},{"level":2,"title":"Troubleshooting","id":"troubleshooting"},{"level":3,"title":"Backup Failed","id":"backup-failed"},{"level":3,"title":"Restoration Failed","id":"restoration-failed"},{"level":3,"title":"Slow Restoration","id":"slow-restoration"},{"level":2,"title":"Related Documentation","id":"related-documentation"}],"format":"markdown","word_count":1870,"content":"# Database Backups\n\nDanubeData provides automatic daily backups for all managed databases with easy point-in-time restoration. This guide covers backup management, restoration procedures, and best practices for disaster recovery.\n\n## Overview\n\nDatabase backups are critical for:\n\n- **Disaster Recovery**: Recover from hardware failures or data center outages\n- **Data Protection**: Protect against accidental deletion or corruption\n- **Compliance**: Meet regulatory requirements for data retention\n- **Testing**: Create copies for testing and development\n- **Migration**: Transfer data between environments\n\n## Automatic Backups\n\n### Default Backup Schedule\n\nAll managed databases include automatic daily backups:\n\n- **Frequency**: Once per day\n- **Time**: During configured maintenance window (default: 2-4 AM UTC)\n- **Retention**: 3 days (managed PostgreSQL also includes continuous backups with 30-day retention)\n- **Storage**: Replicated within the Falkenstein datacenter\n- **Included**: No additional cost for standard retention\n\n### Backup Process\n\n1. **Snapshot Creation**: Consistent snapshot of database created\n2. **Upload**: Backup uploaded to redundant storage\n3. **Verification**: Backup integrity verified\n4. **Retention**: Old backups automatically deleted per retention policy\n5. **Notification**: Dashboard updated with backup status\n\n### What's Included in Backups\n\n- **All Databases**: All databases within the instance\n- **Users and Permissions**: Database users and privileges\n- **Configuration**: Custom database parameters\n- **Schemas**: All tables, indexes, and constraints\n\n> **Note**: Backups do not include application code, OS-level configurations, or files outside the database.\n\n## Backup Configuration\n\n### Adjusting Backup Schedule\n\nConfigure when backups occur:\n\n1. Navigate to your database\n2. Click **Settings** tab\n3. Go to **Backup Configuration**\n4. Set preferred backup time\n5. Click **Save Changes**\n\nChoose a time when database activity is lowest to minimize impact.\n\n### Retention Period\n\nAutomated backups are retained for 3 days at no additional cost. Managed PostgreSQL databases additionally include continuous backups with 30-day retention. There are no paid retention tiers.\n\n## Manual Backups\n\n### Creating On-Demand Backups\n\nCreate manual backups anytime:\n\n1. Navigate to your database\n2. Click **Backups** tab\n3. Click **Create Manual Backup**\n4. Provide a descriptive name\n5. Click **Create Backup**\n\nManual backups are created within minutes and do not count against automatic backup retention.\n\n### When to Create Manual Backups\n\n- Before major application deployments\n- Before database schema changes\n- Before running data migrations\n- Before upgrading database versions\n- Prior to risky maintenance operations\n\n### Manual Backup Retention\n\nManual backups are retained separately:\n\n- **Retention**: Indefinite (until manually deleted)\n- **Cost**: Charged based on backup size (€0.073/GB/month)\n- **Management**: Can be deleted anytime via dashboard\n\n## Restoring from Backups\n\n### Restore Options\n\nYou have two restoration options:\n\n#### 1. Restore to Existing Database\n\nOverwrites the current database with backup data:\n\n- **Downtime**: Database will be unavailable during restore (typically 5-30 minutes)\n- **Data Loss**: All current data will be replaced with backup\n- **Use Case**: Recovery from data corruption or accidental deletion\n\n#### 2. Restore to New Database\n\nCreates a new database instance from backup:\n\n- **No Downtime**: Original database remains operational\n- **Separate Instance**: New database with its own connection details\n- **Use Case**: Testing, development, data analysis\n\n### Restoration Process\n\n#### Restore to Existing Database\n\n1. Navigate to your database\n2. Click **Backups** tab\n3. Select the backup to restore\n4. Click **Restore**\n5. Choose **Restore to Existing Database**\n6. Type database name to confirm\n7. Click **Confirm Restore**\n\n> **Warning**: This will overwrite all current data. This action cannot be undone.\n\n#### Restore to New Database\n\n1. Navigate to your database\n2. Click **Backups** tab\n3. Select the backup to restore\n4. Click **Restore**\n5. Choose **Restore to New Database**\n6. Configure new database:\n   - Database name\n   - Resource profile\n   - Region\n7. Click **Create Database from Backup**\n\nThe new database will be created within 10-20 minutes depending on size.\n\n### Point-in-Time Recovery\n\nDanubeData supports point-in-time recovery (PITR) for all databases:\n\n- **Resolution**: 1-minute increments\n- **Window**: Within backup retention period\n- **How It Works**: Combines base backup with transaction logs\n- **Accuracy**: Restore to exact timestamp\n\n#### Using Point-in-Time Recovery\n\n1. Navigate to **Backups** tab\n2. Click **Point-in-Time Recovery**\n3. Select date and time to restore to\n4. Choose restore destination (existing or new database)\n5. Click **Restore**\n\n> **Example**: If you accidentally deleted data at 3:45 PM, you can restore to 3:44 PM.\n\n## Backup Verification\n\n### Testing Backups\n\nRegularly test backups to ensure they work:\n\n1. **Monthly Tests**: Restore a backup to new database\n2. **Verify Data**: Check that data is intact and accessible\n3. **Test Application**: Connect application to restored database\n4. **Document Results**: Keep records of test results\n5. **Cleanup**: Delete test database after verification\n\n### Backup Integrity\n\nDanubeData automatically verifies backup integrity:\n\n- **Checksum Validation**: Backups validated with checksums\n- **Restore Tests**: Automated restore tests performed periodically\n- **Corruption Detection**: Corrupted backups flagged in dashboard\n- **Multiple Copies**: Backups stored in multiple locations\n\n## External Backups\n\nIn addition to automatic backups, you can create external backups for additional redundancy.\n\n### PostgreSQL Export\n\n#### Using pg_dump\n\n```bash\n# Export entire database\npg_dump -h db-postgres-123456.danubedata.ro \\\n  -U admin \\\n  -d danubedata \\\n  --format=custom \\\n  --file=backup.dump\n\n# Export with compression\npg_dump -h db-postgres-123456.danubedata.ro \\\n  -U admin \\\n  -d danubedata \\\n  --format=custom \\\n  --compress=9 \\\n  --file=backup.dump.gz\n\n# Export specific schemas\npg_dump -h db-postgres-123456.danubedata.ro \\\n  -U admin \\\n  -d danubedata \\\n  --schema=public \\\n  --format=custom \\\n  --file=public_schema.dump\n\n# Export specific tables\npg_dump -h db-postgres-123456.danubedata.ro \\\n  -U admin \\\n  -d danubedata \\\n  --table=users \\\n  --table=orders \\\n  --format=custom \\\n  --file=tables.dump\n```\n\n#### Import PostgreSQL Backup\n\n```bash\n# Restore from dump\npg_restore -h db-postgres-123456.danubedata.ro \\\n  -U admin \\\n  -d danubedata \\\n  --clean \\\n  --if-exists \\\n  backup.dump\n\n# Restore specific table\npg_restore -h db-postgres-123456.danubedata.ro \\\n  -U admin \\\n  -d danubedata \\\n  --table=users \\\n  backup.dump\n```\n\n### MySQL/MariaDB Export\n\n#### Using mysqldump\n\n```bash\n# Export entire database\nmysqldump -h db-mysql-123456.danubedata.ro \\\n  -u admin \\\n  -p \\\n  --single-transaction \\\n  --routines \\\n  --triggers \\\n  --events \\\n  danubedata > backup.sql\n\n# Export with compression\nmysqldump -h db-mysql-123456.danubedata.ro \\\n  -u admin \\\n  -p \\\n  --single-transaction \\\n  danubedata | gzip > backup.sql.gz\n\n# Export specific tables\nmysqldump -h db-mysql-123456.danubedata.ro \\\n  -u admin \\\n  -p \\\n  danubedata users orders > tables_backup.sql\n\n# Export structure only (no data)\nmysqldump -h db-mysql-123456.danubedata.ro \\\n  -u admin \\\n  -p \\\n  --no-data \\\n  danubedata > schema.sql\n```\n\n#### Import MySQL/MariaDB Backup\n\n```bash\n# Import SQL file\nmysql -h db-mysql-123456.danubedata.ro \\\n  -u admin \\\n  -p \\\n  danubedata < backup.sql\n\n# Import compressed backup\ngunzip < backup.sql.gz | mysql -h db-mysql-123456.danubedata.ro \\\n  -u admin \\\n  -p \\\n  danubedata\n```\n\n### Automated External Backups\n\nCreate a cron job for regular external backups:\n\n```bash\n#!/bin/bash\n# /home/user/scripts/backup_database.sh\n\n# Configuration\nDATE=$(date +%Y%m%d_%H%M%S)\nBACKUP_DIR=\"/backups/database\"\nDB_HOST=\"db-postgres-123456.danubedata.ro\"\nDB_USER=\"admin\"\nDB_NAME=\"danubedata\"\n\n# Create backup\npg_dump -h $DB_HOST -U $DB_USER -d $DB_NAME \\\n  --format=custom \\\n  --file=\"$BACKUP_DIR/backup_$DATE.dump\"\n\n# Upload to S3 (optional)\naws s3 cp \"$BACKUP_DIR/backup_$DATE.dump\" \\\n  s3://my-backups/database/\n\n# Delete local backups older than 7 days\nfind $BACKUP_DIR -name \"backup_*.dump\" -mtime +7 -delete\n\n# Delete S3 backups older than 30 days\naws s3 ls s3://my-backups/database/ | \\\n  grep 'backup_' | \\\n  awk '{print $4}' | \\\n  while read file; do\n    file_date=$(echo $file | grep -oP '\\d{8}')\n    if [ $(( ($(date +%s) - $(date -d $file_date +%s)) / 86400 )) -gt 30 ]; then\n      aws s3 rm \"s3://my-backups/database/$file\"\n    fi\n  done\n```\n\nAdd to crontab:\n\n```bash\n# Run daily at 1 AM\n0 1 * * * /home/user/scripts/backup_database.sh >> /var/log/backup.log 2>&1\n```\n\n## Backup Storage\n\n### Storage Location\n\nBackups are stored in:\n\n- **Storage**: Replicated within the Falkenstein datacenter\n- **Offsite Copies**: Export snapshots (see External Backups above) to keep your own copy outside the platform\n\n### Storage Costs\n\n| Backup Type | Retention | Cost |\n|-------------|-----------|------|\n| Automatic snapshots | 3 days | Included |\n| Continuous (managed PostgreSQL) | 30 days | Included |\n| Manual | Until deleted | €0.073/GB/month |\n\n### Backup Size\n\nBackup size depends on:\n\n- **Data Volume**: Amount of data in database\n- **Compression**: Backups are compressed (typically 60-80% reduction)\n- **Changes**: Incremental changes since last backup\n\nView backup sizes in the **Backups** tab of your database.\n\n## Disaster Recovery Planning\n\n### Recovery Time Objective (RTO)\n\nExpected time to restore database:\n\n| Scenario | RTO | Notes |\n|----------|-----|-------|\n| Restore to existing (< 10 GB) | 5-10 min | Includes restore + startup |\n| Restore to existing (10-100 GB) | 10-30 min | Depends on data size |\n| Restore to existing (> 100 GB) | 30-60 min | Large databases take longer |\n| Restore to new database | 15-60 min | Includes provisioning time |\n| Point-in-time recovery | +5-10 min | Additional time for log replay |\n\n### Recovery Point Objective (RPO)\n\nMaximum acceptable data loss:\n\n| Backup Strategy | RPO | Notes |\n|----------------|-----|-------|\n| Daily backups | 24 hours | Standard configuration |\n| Point-in-time recovery | 1 minute | Within retention window |\n| Manual pre-deployment backup | 0 minutes | For planned changes |\n| External backups | Varies | Based on schedule |\n\n### Disaster Recovery Checklist\n\n#### Before Disaster\n\n- [ ] Verify automatic backups are running\n- [ ] Test backup restoration monthly\n- [ ] Document restoration procedures\n- [ ] Store connection details securely\n- [ ] Set up monitoring and alerts\n- [ ] Configure backup retention appropriately\n- [ ] Export snapshots for offsite copies of critical databases\n\n#### During Disaster\n\n- [ ] Assess scope of data loss or corruption\n- [ ] Identify last known good backup\n- [ ] Notify stakeholders of expected downtime\n- [ ] Initiate restoration procedure\n- [ ] Monitor restoration progress\n- [ ] Verify data integrity after restoration\n- [ ] Test application connectivity\n- [ ] Document incident for review\n\n#### After Disaster\n\n- [ ] Perform post-mortem analysis\n- [ ] Update disaster recovery procedures\n- [ ] Implement preventive measures\n- [ ] Restore normal backup schedule\n- [ ] Communicate resolution to stakeholders\n\n## Best Practices\n\n### Backup Strategy\n\n1. **Enable Automatic Backups**: Always keep automatic backups enabled\n2. **Extend Retention**: Use 14 or 30-day retention for production databases\n3. **Manual Backups**: Create manual backups before risky operations\n4. **Test Regularly**: Monthly restoration tests to verify backups work\n5. **External Backups**: Maintain additional external backups for critical data\n6. **Document Procedures**: Keep restoration procedures up-to-date\n7. **Monitor Backups**: Set up alerts for backup failures\n\n### Application Best Practices\n\n1. **Backup Before Migrations**: Always backup before schema changes\n2. **Version Control**: Keep database migration scripts in version control\n3. **Rollback Plans**: Document rollback procedures for deployments\n4. **Data Validation**: Verify data integrity after restoration\n5. **Connection Management**: Handle database unavailability gracefully\n\n### Security Best Practices\n\n1. **Encrypt Backups**: Backups are encrypted at rest by default\n2. **Access Control**: Limit who can restore backups\n3. **Audit Logs**: Monitor backup and restoration activities\n4. **Secure External Backups**: Encrypt external backups if storing off-platform\n5. **Compliance**: Ensure backup retention meets regulatory requirements\n\n## Monitoring and Alerts\n\n### Backup Monitoring\n\nMonitor backup health in dashboard:\n\n- **Last Backup**: Timestamp of most recent backup\n- **Backup Status**: Success or failure\n- **Backup Size**: Current backup size\n- **Next Backup**: Scheduled time for next backup\n- **Retention**: Number of backups retained\n\n### Alert Configuration\n\nSet up alerts for:\n\n- Backup failures\n- Backup size exceeding threshold\n- No backup in 24 hours\n- Backup storage quota exceeded\n\n## Troubleshooting\n\n### Backup Failed\n\n**Symptoms**: Backup marked as failed in dashboard\n\n**Causes**:\n- Database was offline during backup window\n- Insufficient storage space\n- Long-running transactions preventing consistent snapshot\n- Network connectivity issues\n\n**Solutions**:\n- Check database status\n- Ensure database has available storage\n- Review long-running queries\n- Retry backup manually\n- Contact support if issue persists\n\n### Restoration Failed\n\n**Symptoms**: Database restoration fails or database doesn't start\n\n**Causes**:\n- Incompatible database version\n- Insufficient resources on target\n- Corrupted backup\n- Configuration mismatch\n\n**Solutions**:\n- Verify database version compatibility\n- Ensure target has sufficient resources\n- Try different backup\n- Check restoration logs\n- Contact support for assistance\n\n### Slow Restoration\n\n**Symptoms**: Restoration taking longer than expected\n\n**Causes**:\n- Large database size\n- High compression ratio\n- Network limitations\n- Concurrent database operations\n\n**Solutions**:\n- Be patient; large databases take time\n- Schedule restoration during off-peak hours\n- Consider restoring to new database to avoid downtime\n- Monitor restoration progress in dashboard\n\n## Related Documentation\n\n- [PostgreSQL](https://docs.danubedata.ro/databases-postgresql)\n- [MySQL](https://docs.danubedata.ro/databases-mysql)\n- [MariaDB](https://docs.danubedata.ro/databases-mariadb)\n- [Database Replicas](https://docs.danubedata.ro/databases-replicas)\n- [Database Overview](https://docs.danubedata.ro/databases-overview)\n- [Platform Security](https://docs.danubedata.ro/platform-security)\n\n","prev":{"title":"Replicas","slug":"databases-replicas","url":"https://docs.danubedata.ro/databases-replicas","markdown_url":"https://docs.danubedata.ro/databases-replicas.md","json_url":"https://docs.danubedata.ro/databases-replicas.json"},"next":{"title":"Parameter Groups","slug":"databases-parameters","url":"https://docs.danubedata.ro/databases-parameters","markdown_url":"https://docs.danubedata.ro/databases-parameters.md","json_url":"https://docs.danubedata.ro/databases-parameters.json"},"index_url":"https://docs.danubedata.ro/index.json"}