Database Backup & Recovery: Disaster Recovery Guide | Nife Docs
Understand automatic backups, recovery options, and disaster recovery strategies.
Automatic Backups#
What's Included#
All managed databases include automatic backups:
Backup Coverage:
- โ All data
- โ All schemas
- โ Configuration
- โ User accounts
- โ Indexes
Backup Frequency:
- Daily backups at 00:00 UTC
- Weekly full backup
- Monthly long-term archive
Automatic Backup Features:
- No configuration needed
- Runs during low-traffic times
- Encrypted backups
- Geo-redundant storage
- Automated retention
Backup Retention#
How long backups are kept:
| Backup Type | Retention | Keep Up To |
|---|---|---|
| Daily | 7 days | 7 backups |
| Weekly | 30 days | 4 backups |
| Monthly | 1 year | 12 backups |
| Manual | As long as needed | Unlimited |
Automatic Cleanup:
- Old backups deleted automatically
- Compliant with retention policy
- Can extend retention if needed
Point-in-Time Recovery (PITR)#
What is PITR?#
Restore database to any point in the last 7 days:
Available Granularity:
- Minute-level precision
- Any time within 7-day window
- Before data was corrupted
- Before accidental deletion
- Before bad code deployment
How PITR Works:
- Takes daily full backup
- Keeps transaction logs
- Can replay transactions
- Reconstruct any point in time
Using PITR#
Scenario: Accidental Data Delete
How to use:
- Go to Backups
- Click Point-in-Time Recovery
- Select the timestamp you want
- Confirm recovery
- New database created
- Switch applications to new database
Available timestamps:
- All points in last 7 days
- Timezone selection available
- Minute-level precision
Recovery Scenarios#
Scenario 1: Corrupted Data#
Problem:
Recovery:
- Identify when corruption started (14:30)
- Use PITR to restore to 13:00
- Export data from restored database
- Verify data integrity
- Re-import clean data
- Fix application bug
- Deploy fix
Time to recover: 30 minutes to 2 hours
Scenario 2: Accidental Deletion#
Problem:
Recovery:
- Create backup of current database (for safety)
- Use Point-in-Time Recovery
- Restore to before deletion (yesterday 23:00)
- Export deleted records
- Import into current database
- Verify restored data
Time to recover: 15-30 minutes
Scenario 3: Ransomware/Intrusion#
Problem:
Recovery:
- Isolate affected database
- Shut down affected application
- Restore from backup before infection
- Verify no malware in restored data
- Change all credentials
- Re-deploy applications
- Monitor for re-infection
Time to recover: 1-4 hours depending on size
Scenario 4: Failed Migration#
Problem:
Recovery:
- Backup current corrupted database
- Restore from pre-migration backup
- Investigate what went wrong
- Fix migration process
- Retry with fixes
Time to recover: 30 minutes to 2 hours
Manual Backups#
Creating Manual Backups#
Create on-demand backups anytime:
When to create:
- Before major changes
- Before code deployments
- Before version upgrades
- Before scaling operations
- Before configuration changes
- Quarterly for compliance
How to create:
- Go to Backups tab
- Click Create Manual Backup
- Add optional description
- Confirm
Time to complete: 5-60 minutes depending on size
Manual Backup Naming#
Use descriptive names:
Good names:
pre-upgrade-16.1before-migration-20240115quarterly-backup-q1-2024before-schema-change
Bad names:
backup1backup_oldtemp
Naming tips:
- Include purpose
- Include date/version
- Make it searchable
- Document reason
Managing Manual Backups#
View all backups:
- Go to Backups tab
- See all automatic and manual
- Filter by type
- Sort by date
Restore from manual:
- Click Restore on backup
- Choose: new database or replace
- Confirm
Delete manual:
- Click Delete on backup
- Confirm deletion
- Cannot be undone
Backup Exports#
Why Export Backups?#
Use cases:
- Long-term archival (keep beyond 1 year)
- Off-site disaster recovery
- Migration to different system
- Compliance requirements
- Data analysis outside database
Export Options#
PostgreSQL/MySQL Export:
MongoDB Export:
Redis Export:
How to Export#
- Go to Backups
- Click Export on backup
- Select format (SQL, JSON, etc.)
- Download starts
- File saved to your computer
File sizes:
- Small database: 1-100 MB
- Medium database: 100 MB - 1 GB
- Large database: 1-10 GB+
- Download may take time
Importing Exported Backups#
PostgreSQL:
MySQL:
MongoDB:
Disaster Recovery Plan#
Planning for Disasters#
Consider these risks:
- Data corruption
- Accidental deletion
- Hardware failure
- Regional outage
- Security breach
- Application bug
Recovery Time Objectives (RTO)#
How fast can you recover?
| Scenario | Target Time |
|---|---|
| Corruption | 15 minutes |
| Deletion | 30 minutes |
| Failed upgrade | 1 hour |
| Regional outage | 4 hours |
| Complete loss | 24 hours |
Our capabilities:
- PITR: 15 minutes (7-day window)
- From backup: 30 minutes
- From manual export: 1-4 hours
Recovery Point Objective (RPO)#
How much data can you lose?
Our options:
- Daily: Lose at most 1 day of data
- Point-in-time: Lose at most minutes of data
- Real-time replica: Lose zero data
Disaster Recovery Strategy#
Recommended approach:
Daily Backups (automatic)
- Included with service
- Retain 7 days
- Geo-redundant
Point-in-Time Recovery
- Available 7 days
- Minute-level precision
- No setup needed
Manual Backups (monthly)
- Created before major changes
- Stored separately
- Documented location
Exported Backups (quarterly)
- SQL/JSON export
- Stored off-site
- Long-term archive
Read Replicas (optional)
- Different region
- Always in sync
- Instant failover
Testing Recovery#
Regular Testing#
Test quarterly:
- Create manual backup
- Restore to test database
- Verify data integrity
- Test application connects
- Validate all data present
- Document results
Test Procedures#
Unit Test Recovery:
Integration Test:
- Restore backup to new database
- Update connection string
- Start application
- Run smoke tests
- Check all features work
- Verify data consistency
Load Test:
- Restore to test database
- Run performance tests
- Check query speed
- Monitor resource usage
- Document results
Backup Best Practices#
1. Verify Backups Work#
- Test restoration quarterly
- Document procedures
- Time the recovery process
- Train team on recovery
2. Keep Multiple Copies#
- Automatic daily
- Manual monthly
- Exported quarterly
- Off-site storage
3. Retention Policy#
- Keep daily 7 days
- Keep weekly 30 days
- Keep monthly 1 year
- Archive as needed
4. Document Everything#
- Backup schedule
- Retention policy
- Recovery procedures
- Contact information
5. Encryption#
- Backups encrypted at rest
- Encrypted in transit
- Store encryption keys securely
- Document key location
6. Regular Testing#
- Test recovery quarterly
- Update procedures
- Train new team members
- Time your recovery
7. Monitor Backups#
- Verify daily backups complete
- Check backup size trends
- Monitor storage usage
- Alert on failures
Compliance & Regulations#
GDPR Requirements#
- Right to be forgotten: Delete on request
- Data portability: Export data
- Breach notification: 72 hours
- Data residency: Keep in EU
Our support:
- Export data on request
- Geo-redundant backups in EU
- Encryption at rest
- Access logs for audit
HIPAA Requirements#
- Encrypted backups
- Access control
- Audit logs
- Disaster recovery
Our support:
- AES-256 encryption
- Role-based access
- Comprehensive logging
- Backup redundancy
Other Regulations#
- SOC 2: Audit reports available
- ISO 27001: Certification available
- PCI-DSS: Payment data protection
- Industry-specific: Consult compliance team
Next Steps#
- Managing Databases - Scaling and monitoring
- Best Practices - Optimization tips
- Troubleshooting - Common issues
Support#
Questions about backups?
- Check sections above
- Test recovery process
- Contact support: [email protected]