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 (repeatable, each optionally BACKUP:TARGET 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. Stacks can be remapped on the way in: —relocate moves a stack to another node, —rename changes stack names (old:new), —override rewrites stack properties ([STACK:]host=OLD:NEW rewrites one ingress hostname, [STACK:]hosts=NEW 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 -b mydb.bak --relocate myblog:node-2 --yes
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 target environment
-f, --file string single backup file to recover from (.bak or .bkg)
-b, --from-backup stringArray backup file to recover from (BACKUP[:TARGET]; repeatable)
-h, --help help for recover
-n, --node string default target node for all stacks
--override strings override stack properties ([STACK:]host=OLD:NEW or [STACK:]hosts=NEW ingress-hostname rewrites; repeatable)
--relocate strings relocate STACK:NODE during recovery
--rename strings rename stacks during recovery (old:new)
--runtime string target runtime (compose|swarm|podman)
--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 provider name for all recovered stacks
-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