Backup and restore
Roxa's state (in the compose production stack) has two parts, and they must be backed up consistently (from the same point in time):
| What | Where | Contents |
|---|---|---|
| Segments | the MinIO bucket roxa | the data itself (messages) |
| Metadata | the docker volume roxa-data | topic configs, the segment index, committed offsets |
Backup
bash
# metadata (the volume):
docker run --rm -v roxa_roxa-data:/data -v "$PWD:/backup" alpine \
tar czf /backup/roxa-meta-$(date +%F).tgz -C /data .
# segments: mirror the MinIO bucket to external S3/disk:
docker compose exec minio mc mirror local/roxa /path/to/backup
# or mc mirror to an external alias (another S3)Restore
The reverse operation — before starting the broker:
- Unpack the metadata archive back into the
roxa-datavolume. mc mirrorthe bucket from the backup back into MinIO.docker compose up -d.
External S3 instead of MinIO
If storage is an external S3 service with its own replication/versioning — segment backup is covered by its facilities, and only the metadata volume remains.