Backups
What the server does by itself
The kit adds two scheduled jobs to root's crontab:
| When | What | Where |
|---|---|---|
| Every night at 02:00 | All databases, Redis and /opt/eurion/config | /opt/eurion/backups/postgres/eurion-backup-<time>.tar.gz |
| Sundays at 03:00 | Compose files and /opt/eurion/config | /opt/eurion/backups/config/ |
The times are in the server's time zone. The nightly copies are kept for 30 days. The nightly archive is also copied to the eurion-backups bucket in the server's own MinIO storage.
A backup is also taken automatically before every update, and after the installation.
Logs: /opt/eurion/logs/backup.log and /opt/eurion/logs/backup-cron.log.
This is not enough on its own
All copies are on the same server. If the server or the disk is lost, the copies are lost too. Also, these are not included:
- uploaded files (MinIO,
/opt/eurion/data/minio) - the search index (Meilisearch, can be rebuilt)
- the Let's Encrypt certificates (obtained again)
- passwords and keys in
/opt/eurion/deploy/generated/
Regularly copy what is listed in Copy to another location to another machine.
Take a backup now
sudo /opt/eurion/config/backup.shThis is the same script that runs every night and before updates.
List the backups that exist:
sudo eurion-ctl backup listCheck that an archive can be read:
sudo eurion-ctl backup verify /opt/eurion/backups/postgres/eurion-backup-20261025_020000.tar.gzDo not use eurion-ctl backup create
In 1.6.4, eurion-ctl backup create (and eurion-ctl backup without arguments) does not include every database, and deletes all but the seven most recent archives in the same directory, including the nightly copies. Use backup.sh above.
Copy to another location
This is what you need to rebuild the server:
| Directory | Contents |
|---|---|
/opt/eurion/backups/postgres/ | The nightly database archives |
/opt/eurion/data/minio/ | All uploaded files |
/opt/eurion/deploy/generated/ | Configuration, passwords and keys (secrets.yml) |
/opt/eurion/data/collabora/proof_key | The key for document editing, if features.office is on |
An example with rsync to another server, which you can add to root's crontab after 02:00:
sudo rsync -a --delete /opt/eurion/data/minio/ backup@backup.example.se:/srv/eurion/minio/
sudo rsync -a /opt/eurion/backups/postgres/ backup@backup.example.se:/srv/eurion/postgres/
sudo rsync -a /opt/eurion/deploy/generated/ backup@backup.example.se:/srv/eurion/generated/Protect the copies
The archives and generated/ contain all data and all passwords. Encrypt them or store them somewhere only you have access to. A copy of secrets.yml that goes astray gives access to the whole installation.
Restoring the databases
The restore overwrites all databases with the contents of the archive. Everything written after the archive was taken is lost.
Stop the services (the database keeps running):
bashsudo docker compose --project-directory /opt/eurion/compose --env-file /opt/eurion/compose/.env \ -f /opt/eurion/compose/services.yml stopRestore. The script asks for
YES:bashsudo /opt/eurion/config/restore.sh /opt/eurion/backups/postgres/eurion-backup-20261025_020000.tar.gzTo restore only one database, give its name after the archive, for example
eurion_messaging.Start the services again:
bashsudo docker compose --project-directory /opt/eurion/compose --env-file /opt/eurion/compose/.env \ -f /opt/eurion/compose/services.yml startCheck:
bashsudo eurion-ctl status
The archive must come from the same version of Eurion as the one installed. If the versions differ, contact support first.
Restoring uploaded files
The files are in /opt/eurion/data/minio. Stop MinIO, put the directory back from your copy and start MinIO again:
sudo docker stop eurion-minio
sudo rsync -a --delete backup@backup.example.se:/srv/eurion/minio/ /opt/eurion/data/minio/
sudo docker start eurion-minioRestore the databases and the files from roughly the same point in time, otherwise there may be files the database does not know about, or the other way round.
Backups and updates
A copy is taken before every update. It is used by the automatic rollback if a migration fails, and by eurion-ctl rollback-update --restore-db.