Backup & Restore
Orimora includes an automated backup system that creates daily database dumps and weekly Markdown exports.
Configuration
Section titled “Configuration”Add the following environment variables to your .env file:
BACKUP_ENABLED=trueBACKUP_PATH=/backups/orimoraBACKUP_RETENTION_DAILY=7BACKUP_RETENTION_WEEKLY=4BACKUP_SCHEDULE=0 3 * * *| Variable | Description | Default |
|---|---|---|
BACKUP_ENABLED | Enable automated backups | false |
BACKUP_PATH | Directory for backup files | /backups/orimora |
BACKUP_RETENTION_DAILY | Daily DB dumps to keep | 7 |
BACKUP_RETENTION_WEEKLY | Weekly Markdown exports to keep | 4 |
BACKUP_SCHEDULE | Cron expression (UTC) | 0 3 * * * |
Backup Layers
Section titled “Backup Layers”Database (daily)
Section titled “Database (daily)”A full PostgreSQL dump using pg_dump --format=custom. This is the primary backup method and captures all data including documents, users, settings, and metadata.
Markdown Export (weekly)
Section titled “Markdown Export (weekly)”Every Sunday, Orimora exports all collections as ZIP files containing Markdown files with YAML frontmatter. These are human-readable and can be imported into other systems (including Obsidian).
Redis & Uploads
Section titled “Redis & Uploads”- Redis: Configure Redis persistence (
BGSAVE) separately — sessions will regenerate if lost. - Uploads: Use
rsyncor S3 sync to back up the/uploads/directory.
Admin UI
Section titled “Admin UI”Navigate to Settings → Admin → Backups to:
- View current backup status and health
- Browse backup history
- Manually trigger a backup
Restore
Section titled “Restore”Full Restore
Section titled “Full Restore”# Stop the applicationdocker compose stop app
# Restore the databasepg_restore --clean --if-exists --dbname=knowledgebase /backups/orimora/orimora-db-TIMESTAMP.dump
# Restore uploadsrsync -av /backup-source/uploads/ /app/uploads/
# Restartdocker compose up -d appSingle Collection
Section titled “Single Collection”Import a Markdown ZIP file via Settings → Collection → Import.
Single Document
Section titled “Single Document”Use the built-in revision history to restore any previous version of a document.
Health Monitoring
Section titled “Health Monitoring”The system alerts when the last successful backup is older than 48 hours. Use the status API for external monitoring:
GET /api/admin/backup.statusReturns healthOk: true/false and details about the last backup.