Skip to content
SHC Docs

shc backup restore

restore from a backup

Restore data from a backup. Exactly one selector is required: —id (a backup from shc backup ls), —file (a .bak/.bkg archive on disk), or —before (the latest backup older than a relative interval, where “0m” means the newest). The stack is stopped for the replay unless —keep-running, and a pre-restore safety backup is taken first unless —no-rollback. —with-connected/—with-dependants expand a single —id into its consistency group. A —file exported from another cluster may need —secrets-password (or —secrets-password-file) to decrypt its sealed secrets.

shc backup restore [flags]
shc backup restore --id 9f3c2a1e -s myblog --yes
shc backup restore --before 7d -s myblog
shc backup restore --file ./myblog.bak --secrets-password-file pw.txt
shc backup restore --id 9f3c2a1e --with-connected --yes
--before string restore the latest backup older than this relative interval (e.g. 0m, 1h, 7d)
-e, --environment string target environment
--file string backup file to restore from
--force force restore over running stack
-h, --help help for restore
--id string backup ID to restore from
--keep-running don't stop the stack before restore
--no-jobs skip backup.yaml pre/restore/post job phases
--no-rollback skip the pre-restore safety backup
--paths string restrict restore to comma-separated archive paths
--runtime string target runtime (compose|swarm|podman)
--secrets-password stringArray candidate password to decrypt the backup's secrets when restoring --file from another cluster (repeatable; tried after the vault master)
--secrets-password-file stringArray file of newline-separated candidate passwords (repeatable). Also reads $SHC_SECRETS_PASSWORDS / $SHC_SECRETS_PASSWORD_FILES
-s, --stack string target stack name (override)
--strategy string merge strategy (replace|merge|skip) (default "replace")
--with-connected restore every backup sharing the target's consistency group (requires --id)
--with-dependants restore the target plus its dependants' backups (requires --id)
-y, --yes assume yes to prompts
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)