docs/backup.md

Backing up

Everything Shrok knows lives in its data folder: chats, memory, saved items, schedules, approvals and the SimpleX keys that make it your contact. Back up that folder while Shrok is stopped, because its databases may be mid-write while it runs.

InstallData folderStopStart
Homebrew~/Library/Application Support/Shrokbrew services stop shrokbrew services start shrok
Debian or Ubuntu/var/lib/shroksudo systemctl stop shroksudo systemctl start shrok
Dockerthe volume <folder>_shrok-data, where <folder> is the name of the folder holding compose.yamldocker compose stopdocker compose start

For example, on Debian or Ubuntu:

sh
1sudo systemctl stop shrok
2sudo sh -c '
3 PRIVATE_UMASK=0077
4 umask "$PRIVATE_UMASK"
5 backup_dir=$(mktemp -d /var/backups/shrok.XXXXXXXX)
6 tar -czf "$backup_dir/shrok-backup.tar.gz" -C /var/lib shrok
7 printf "Backup saved in %s\n" "$backup_dir"
8'
9sudo systemctl start shrok

In Docker:

sh
1docker compose stop
2backup_dir=$(mktemp -d "$PWD/shrok-backup.XXXXXXXX")
3docker run --rm -v "$(basename "$PWD")_shrok-data:/data:ro" -v "$backup_dir":/backup \
4 debian:trixie-slim sh -c 'PRIVATE_UMASK=0077; umask "$PRIVATE_UMASK"; tar -czf /backup/shrok-backup.tar.gz -C / data'
5printf 'Backup saved in %s\n' "$backup_dir"
6docker compose start

These commands create a fresh private backup directory and set a private umask inside the process that creates the archive. The archive is owned by root and readable only by root. Use sudo when copying it, and keep the destination private too. The backup holds your SimpleX keys and everything you told Shrok.

Restoring

Stop Shrok, replace the data folder with the backup, keeping its owner and its 0700 mode, then start Shrok. Your phone stays paired, because the keys come back with the folder. Don't run the restored copy and the original at the same time: they would be the same SimpleX contact. Shrok refuses to start twice on one folder, but it can't see a copy on another machine.