Skip to content
SHC Docs

shc recover

recover deployments from backup archives

Recover deployments from exported backup archives. --from-backup/-b takes a .bak file or the restic:: location shc backup ls -o json lists for an archive, or the id shc backup orphan ls lists for an archive another cluster left in the repository (repeatable, each optionally = to rename the stack); --file/-f takes a single .bak or .bkg group archive; --consistency-id recovers a consistency group directly from the backup store with no archive at all.

--dry-run prints the recovery plan without executing. A real run executes asynchronously on the daemon and this command streams per-phase progress until it finishes. Deployments can be remapped on the way in: --rename changes stack names (=), --override rewrites ingress hostnames ([:]host:= rewrites one hostname, [:]hosts= rewrites them all: recover under a new host so the source cluster’s host is never replayed), and --skip-integration drops integrations. Archives sealed under another cluster’s vault password need --secrets-password or --secrets-password-file.

shc recover [flags]
shc recover -f ./cluster.bkg --dry-run
shc recover -f ./cluster.bkg --yes
shc recover -b myblog.bak=myblog2 -b mydb.bak --yes
shc recover -f ./cluster.bkg --rename blog=blog2 --override host:old.example=new.example
shc recover --consistency-id 4c2f31d8 --secrets-password-file pw.txt
--consistency-id string recover a consistency group directly from the restic store (no .bkg export); restores each member's latest backup in place. Takes precedence over --file/--from-backup
--dry-run show what would be recovered without executing
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
-f, --file string single backup file to recover from (.bak or .bkg)
-b, --from-backup stringArray backup file, restic location or orphan id to recover from (<backup>[=<target>]; repeatable)
-h, --help help for recover
--override strings override ingress hostnames ([<stack>:]host:<old>=<new> or [<stack>:]hosts=<new>; repeatable)
--rename strings give recovered deployments new stack names (<old>=<new>)
--runtime string target runtime (docker|podman|incus|apple)
--secrets-password stringArray candidate password to decrypt backup secrets (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
--skip-integration strings skip integration during recovery
--storage string storage backend to restore all recovered deployments onto, overriding the backend recorded in each backup; a backend this cluster cannot serve is refused before any data is restored
-y, --yes skip confirmation prompt
--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)
-s, --stack string stack name (default: $SHC_STACK)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc - Selfhosted Cloud CLI