BackupEngine Overview
The BackupEngine enables:Incremental Backups
Only new data is backed up, saving time and space.
Consistent Snapshots
Backups are consistent point-in-time snapshots.
Parallel Operations
Multiple backup operations can run concurrently.
Verification
Built-in tools to verify backup integrity.
Creating Backups
Opening a BackupEngine
Creating a New Backup
Backup Options
BackupEngineOptions
CreateBackupOptions
Backup Information
Getting Backup Info
Verifying Backups
VerifyBackup() checks file existence and sizes by default. Pass true as the second argument to also verify checksums: VerifyBackup(backup_id, true)Restoring from Backup
Basic Restore
Restore from Latest Backup
Restore Options
Managing Backups
Deleting Old Backups
Garbage Collection
Complete Example
Advanced Features
Rate Limiting
Limit backup/restore I/O rate to avoid impacting production:Custom Environment
Use a custom environment for remote backups (e.g., S3):Metadata
Store application metadata with backups:Backup Strategies
- Continuous Backup
- Before Major Operations
- Retention Policy
- Off-site Backups
Take backups periodically (e.g., hourly) to minimize data loss.
Best Practices
1
Test restores regularly
Periodically test backup restoration to ensure backups are valid and complete.
2
Verify backups
Use
VerifyBackup() with checksum verification enabled for critical backups.3
Monitor backup size
Track backup sizes and growth over time to plan storage capacity.
4
Close database before restore
Always close the database before restoring from a backup.
5
Use separate backup directory
Store backups in a different location from the main database.
6
Implement retention policies
Don’t keep backups forever. Implement a policy based on your requirements.
Monitoring and Debugging
Backup Statistics
Handling Errors
Troubleshooting
Backup takes too long
Backup takes too long
- Enable
share_table_filesfor incremental backups - Increase
max_background_operations - Use rate limiting if I/O is affecting production
Restore fails
Restore fails
- Verify the backup first with
VerifyBackup() - Ensure database is closed before restoring
- Check disk space in destination directory
Backup directory grows too large
Backup directory grows too large
- Use
PurgeOldBackups()to remove old backups - Verify
share_table_filesis enabled - Run
GarbageCollect()to clean up orphaned files
Next Steps
Configuration
Learn about backup configuration options
Performance Tuning
Optimize backup and restore performance