Backup & Restore
Protect your Prisme.ai platform data with comprehensive backup and restore procedures
A robust backup and restore strategy is essential for protecting your Prisme.ai platform data and ensuring business continuity. This guide provides detailed instructions for backing up and restoring all components of your self-hosted Prisme.ai environment.
Backup Strategy
Your Prisme.ai platform requires backing up several components:
Client-Managed Databases
- MongoDB/compatible database
- Elasticsearch/OpenSearch
- Redis
Object Storage
- S3 or compatible object storage
- Document files and attachments
Configuration
- Kubernetes manifests
- Helm values
- Terraform state files
Secrets
- Kubernetes secrets
- Certificate files
- API keys and credentials
Your Prisme.ai platform requires backing up several components:
Client-Managed Databases
- MongoDB/compatible database
- Elasticsearch/OpenSearch
- Redis
Object Storage
- S3 or compatible object storage
- Document files and attachments
Configuration
- Kubernetes manifests
- Helm values
- Terraform state files
Secrets
- Kubernetes secrets
- Certificate files
- API keys and credentials
Recommended backup frequencies based on data criticality:
Component | Frequency | Retention |
---|---|---|
MongoDB | Daily | 30 days |
Elasticsearch/OpenSearch | Daily | 14 days |
Redis | Daily | 7 days |
S3 Storage | Weekly (incremental) | 90 days |
Configuration | After changes | Last 10 versions |
Adjust backup frequency based on your organization’s Recovery Point Objective (RPO) requirements.
Database Backup Procedures
Create MongoDB Backup
Use mongodump to create a full backup of your MongoDB database:
Verify MongoDB Backup
Ensure the backup contains all expected data:
Schedule Regular Backups
Create a cron job to automate daily backups:
Example backup script (mongodb-backup-script.sh
):
Create MongoDB Backup
Use mongodump to create a full backup of your MongoDB database:
Verify MongoDB Backup
Ensure the backup contains all expected data:
Schedule Regular Backups
Create a cron job to automate daily backups:
Example backup script (mongodb-backup-script.sh
):
Create Elasticsearch/OpenSearch Backup
Use Elasticsearch snapshot API or elasticdump for backups:
Verify Elasticsearch/OpenSearch Backup
Ensure the backup contains all expected indices and data:
Schedule Regular Backups
Create a cron job to automate daily backups:
Configure Redis Persistence
Ensure Redis is configured for persistence:
Create Redis Backup
Use the SAVE command or copy the RDB file:
Schedule Regular Backups
Create a cron job to automate daily backups:
Back Up S3 Data
Use AWS CLI or compatible tools to back up your S3 storage:
Enable Versioning
Enable versioning on your S3 bucket for built-in backup protection:
Set Up Lifecycle Policies
Configure lifecycle policies to manage backup retention:
Example lifecycle-config.json
:
Configuration Backup
Back Up Kubernetes Resources
Save your Kubernetes configuration resources:
Back Up Helm Values
Save your Helm chart values for each release:
Back Up Terraform State
If using Terraform, back up your state files:
Using remote state in Terraform (like S3 with versioning or Terraform Cloud) provides built-in backup capabilities.
Restore Procedures
Prepare for Restore
Before restoring, stop services that interact with the database:
Restore MongoDB Data
Use mongorestore to restore from your backup:
Restoring will overwrite existing data. Be sure to validate your backup before proceeding.
Restart Services
After restore is complete, scale the services back up:
Prepare for Restore
Before restoring, stop services that interact with the database:
Restore MongoDB Data
Use mongorestore to restore from your backup:
Restoring will overwrite existing data. Be sure to validate your backup before proceeding.
Restart Services
After restore is complete, scale the services back up:
Prepare for Restore
Stop services that interact with Elasticsearch:
Restore Data
Restart Services
After restore is complete, restart the services:
Stop Redis Server
If possible, gracefully shut down Redis:
If using Redis in Kubernetes:
Replace RDB File
Copy the backup RDB file to Redis data directory:
Restart Redis
Start Redis service with the restored data:
Prepare for Restore
Consider the impact of restoration on your application:
Restore S3 Data
Sync data from your backup location:
If using versioning, you can restore specific versions of objects:
Verify Restoration
Check that files have been properly restored:
Restart Services
Resume normal operations:
Configuration Restore
Restore Kubernetes Resources
Apply your backed-up Kubernetes configurations:
Be cautious when restoring resources. Consider restoring specific resource types instead of everything at once:
Restore Helm Releases
Use your backed-up values to reinstall or upgrade Helm releases:
Restore Terraform State
If you need to restore Terraform state:
For remote state, follow your backend provider’s restoration process.
Disaster Recovery Planning
Define your recovery objectives to guide your backup strategy:
RPO (Recovery Point Objective)
Maximum acceptable data loss in time:
- Critical data: RPO < 1 hour
- Important data: RPO < 24 hours
- Regular data: RPO < 1 week
RTO (Recovery Time Objective)
Maximum acceptable time to restore service:
- Critical services: RTO < 4 hours
- Important services: RTO < 24 hours
- Regular services: RTO < 3 days
Define your recovery objectives to guide your backup strategy:
RPO (Recovery Point Objective)
Maximum acceptable data loss in time:
- Critical data: RPO < 1 hour
- Important data: RPO < 24 hours
- Regular data: RPO < 1 week
RTO (Recovery Time Objective)
Maximum acceptable time to restore service:
- Critical services: RTO < 4 hours
- Important services: RTO < 24 hours
- Regular services: RTO < 3 days
Plan for different disaster recovery scenarios:
Regularly test your disaster recovery procedures:
Scheduled Testing
Conduct regular DR tests:
- Quarterly: Component-level recovery
- Bi-annually: Full platform recovery
- Annually: Regional failover (if applicable)
Test Documentation
Document each test with:
- Date and scope
- Procedures followed
- Time to recover
- Issues encountered
- Improvements identified
Continuous Improvement
Update procedures based on test results:
- Optimize recovery scripts
- Improve automation
- Address gaps or failures
- Update documentation
Testing and Validation
Verify Backup Integrity
Regularly test your backups to ensure they can be restored:
Validation Checkpoints
Establish validation points for successful restoration:
Data Validation
- Record counts match pre-backup state
- Sample record content is intact
- Relationships between data are preserved
- Application-specific data tests pass
Functionality Validation
- Core services start successfully
- API endpoints respond correctly
- Authentication and authorization work
- Data processing functions operate properly
- UI elements display and function as expected
Document Restoration Procedures
Maintain detailed, tested restoration runbooks:
- Step-by-step instructions
- Required credentials and access
- Validation checkpoints
- Troubleshooting guidance
- Contact information for support
Next Steps
Was this page helpful?