Skip to content

Backups ​

What the server does by itself ​

The kit adds two scheduled jobs to root's crontab:

WhenWhatWhere
Every night at 02:00All databases, Redis and /opt/eurion/config/opt/eurion/backups/postgres/eurion-backup-<time>.tar.gz
Sundays at 03:00Compose 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 ​

bash
sudo /opt/eurion/config/backup.sh

This is the same script that runs every night and before updates.

List the backups that exist:

bash
sudo eurion-ctl backup list

Check that an archive can be read:

bash
sudo eurion-ctl backup verify /opt/eurion/backups/postgres/eurion-backup-20261025_020000.tar.gz

Do 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:

DirectoryContents
/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_keyThe 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:

bash
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.

  1. Stop the services (the database keeps running):

    bash
    sudo docker compose --project-directory /opt/eurion/compose --env-file /opt/eurion/compose/.env \
      -f /opt/eurion/compose/services.yml stop
  2. Restore. The script asks for YES:

    bash
    sudo /opt/eurion/config/restore.sh /opt/eurion/backups/postgres/eurion-backup-20261025_020000.tar.gz

    To restore only one database, give its name after the archive, for example eurion_messaging.

  3. Start the services again:

    bash
    sudo docker compose --project-directory /opt/eurion/compose --env-file /opt/eurion/compose/.env \
      -f /opt/eurion/compose/services.yml start
  4. Check:

    bash
    sudo 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:

bash
sudo docker stop eurion-minio
sudo rsync -a --delete backup@backup.example.se:/srv/eurion/minio/ /opt/eurion/data/minio/
sudo docker start eurion-minio

Restore 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.

Eurion — communication that runs on your own server.