Phase 4 + M5: Low-priority fixes and frontend component integration
M5: TagBadge integrated into ContactDetail (replaces plain Badge) M5: EntityHistoryPanel integrated into ContactDetail (timeline section) L1: Replace document.write() with Blob URL in print.ts (XSS-safe) L2: AI UI Control feedback storage capped at 100 entries (FIFO eviction) L3: Backup & Restore documentation added to DEPLOY.md Verified: Backend import OK, TypeScript 0 errors
This commit is contained in:
@@ -119,3 +119,54 @@ python scripts/deploy.py --migrate-only
|
||||
```bash
|
||||
python scripts/deploy.py --skip-build # startet Worker automatisch
|
||||
```
|
||||
|
||||
## Backup & Restore
|
||||
|
||||
### Backup (PostgreSQL)
|
||||
|
||||
```bash
|
||||
# Full DB backup (run on the host or via docker exec)
|
||||
docker exec crm-postgres pg_dump -U crm_user -Fc crm_db > backup_$(date +%Y%m%d_%H%M%S).dump
|
||||
|
||||
# Backup mit Custom-Format (komprimiert, parallel restore-fähig)
|
||||
docker exec crm-postgres pg_dump -U crm_user -Fc -Z 9 crm_db > backup_$(date +%Y%m%d).dump
|
||||
```
|
||||
|
||||
### Backup (Redis — Sessions/Queues)
|
||||
|
||||
```bash
|
||||
# Redis RDB Snapshot
|
||||
docker exec crm-redis redis-cli -a "$REDIS_PASSWORD" SAVE
|
||||
docker cp crm-redis:/data/dump.rdb redis_backup_$(date +%Y%m%d).rdb
|
||||
```
|
||||
|
||||
### Backup (File Storage)
|
||||
|
||||
```bash
|
||||
# Local storage volume
|
||||
docker run --rm -v leocrm-fix_storage:/data -v $(pwd):/backup alpine \
|
||||
tar czf /backup/storage_$(date +%Y%m%d).tar.gz /data
|
||||
```
|
||||
|
||||
### Restore (PostgreSQL)
|
||||
|
||||
```bash
|
||||
# Stop app containers
|
||||
docker compose stop crm-app crm-worker
|
||||
|
||||
# Restore DB
|
||||
docker exec -i crm-postgres pg_restore -U crm_user -d crm_db --clean < backup_20260726.dump
|
||||
|
||||
# Restart app
|
||||
docker compose start crm-app crm-worker
|
||||
```
|
||||
|
||||
### Automatisierte Backups (Cron)
|
||||
|
||||
```bash
|
||||
# /etc/cron.d/leocrm-backup
|
||||
0 2 * * * root docker exec crm-postgres pg_dump -U crm_user -Fc crm_db > /backups/leocrm_$(date +\%Y\%m\%d).dump
|
||||
0 3 * * * root find /backups -name 'leocrm_*.dump' -mtime +30 -delete
|
||||
```
|
||||
|
||||
**Empfehlung:** Tägliche DB-Backups, 30 Tage Aufbewahrung. Storage-Backup wöchentlich.
|
||||
|
||||
Reference in New Issue
Block a user