Backup and restore# Backup and restore A useful backup must make it possible to restore a coherent state of the business, documents and structuring secrets. ## Elements to protect - PostgreSQL database; - Redis data if their recovery is required; - volume `isms_document_files` or S3/MinIO bucket; - volume `jwt_keys` ; - configuration and secrets kept outside Git; - exact version of the code and images deployed. Composer and npm dependencies can be rebuilt; they do not replace data backup. ## Prepare a backup Set RPO, RTO, retention, encryption, offsite location and responsible. Check available space and log application versions and migrations. PostgreSQL logical example to adapt to your environment: ```bash docker compose exec -T postgres pg_dump \ -U "$POSTGRES_USER" -d "$POSTGRES_DB" -Fc > riskpilot.dump ``` Do not place a password in the device history. Then back up documentary volumes and keys with a tool that preserves permissions and integrity. ## Check A successful order is not enoug