mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-02-09 21:13:09 +00:00
- Backend: Rust/Axum with PostgreSQL, plugin architecture - Frontend: Astro with polished UI - Voting methods: Approval, Ranked Choice, Schulze, STAR, Quadratic - Features: Liquid delegation, transparent moderation, structured deliberation - Documentation: User and admin guides in /docs - Deployment: Docker/Podman compose files for production and demo - Demo: Seeded data with 3 communities, 13 users, 7 proposals License: AGPLv3
2.7 KiB
2.7 KiB
Backup & Recovery
Protecting your Likwid data.
What to Backup
| Component | Location | Priority |
|---|---|---|
| PostgreSQL database | Database server | Critical |
| Uploaded files | /uploads (if configured) |
High |
| Configuration | .env files |
High |
| SSL certificates | Reverse proxy | Medium |
Database Backup
Manual Backup
# Full backup
pg_dump -h localhost -U likwid -F c likwid_prod > backup_$(date +%Y%m%d).dump
# SQL format (readable)
pg_dump -h localhost -U likwid likwid_prod > backup_$(date +%Y%m%d).sql
Automated Backup Script
#!/bin/bash
# /etc/cron.daily/likwid-backup
BACKUP_DIR="/var/backups/likwid"
DATE=$(date +%Y%m%d_%H%M%S)
RETENTION_DAYS=30
# Create backup
pg_dump -h localhost -U likwid -F c likwid_prod > "$BACKUP_DIR/likwid_$DATE.dump"
# Compress
gzip "$BACKUP_DIR/likwid_$DATE.dump"
# Remove old backups
find "$BACKUP_DIR" -name "*.dump.gz" -mtime +$RETENTION_DAYS -delete
# Optional: sync to remote storage
# aws s3 cp "$BACKUP_DIR/likwid_$DATE.dump.gz" s3://bucket/backups/
Containerized Backup
# If using podman-compose
podman exec likwid-prod-db pg_dump -U likwid likwid_prod > backup.sql
Recovery
Full Restore
# Drop and recreate database
psql -h localhost -U postgres -c "DROP DATABASE IF EXISTS likwid_prod;"
psql -h localhost -U postgres -c "CREATE DATABASE likwid_prod OWNER likwid;"
# Restore from dump
pg_restore -h localhost -U likwid -d likwid_prod backup.dump
# Or from SQL
psql -h localhost -U likwid likwid_prod < backup.sql
Point-in-Time Recovery
For critical installations, configure PostgreSQL WAL archiving:
# postgresql.conf
archive_mode = on
archive_command = 'cp %p /var/lib/postgresql/archive/%f'
Demo Instance Reset
The demo instance can be reset to initial state:
# Windows
.\scripts\demo-reset.ps1
# Linux
./scripts/demo-reset.sh
This removes all data and re-runs migrations with seed data.
Disaster Recovery Plan
Preparation
- Document backup procedures
- Test restores regularly (monthly)
- Keep offsite backup copies
- Document recovery steps
Recovery Steps
- Provision new server if needed
- Install Likwid dependencies
- Restore database from backup
- Restore configuration files
- Start services
- Verify functionality
- Update DNS if server changed
Recovery Time Objective (RTO)
Target: 4 hours for full recovery
Recovery Point Objective (RPO)
Target: 24 hours of data loss maximum (with daily backups)
Testing Backups
Monthly backup test procedure:
- Create test database
- Restore backup to test database
- Run verification queries
- Document results
- Delete test database