shc backup restore
shc backup restore
Section titled “shc backup restore”restore from a backup
Synopsis
Section titled “Synopsis”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 deployment 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 backup whose secrets were sealed under a
password this cluster’s vault master is not (one exported from another
cluster, or any archive taken before a shc vault rotate) needs
--secrets-password (or --secrets-password-file) to decrypt them. That
applies to --id just as it does to --file: the candidates used to be
dropped on the --id paths, so the restore reported failure and named a
remedy it would then ignore.
--file is the portable path and it is fully supported: a one-off
.bak restores directly, on this cluster or any other, with no row
in the index and no repository involved. If you want the archive to
become an addressable backup as well (listed, verifiable, mountable,
swept by retention), run shc backup import <archive> first and
restore it by --id thereafter.
--as
shc backup restore [backup-id|name] [flags]Examples
Section titled “Examples” shc backup restore 9f3c2a1e -s myblog --yes shc backup restore --id 9f3c2a1e --as myblog-copy 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 --yesOptions
Section titled “Options” --as string restore as a new deployment --before string restore the latest backup older than this relative interval (e.g. 0m, 1h, 7d) --file string backup file to restore from --force force restore over a running deployment -h, --help help for restore --id string backup ID or name to restore from --into string target tenant for the new deployment --keep-running don't stop the deployment before restore --map stringArray write an archived mount into the deployment's mount of another name, <archive mount>=<deployment mount> (repeatable) --no-jobs skip backup.yaml pre/restore/post job phases --no-rollback skip the pre-restore safety backup --paths string restrict the restore to comma-separated archive subjects: a mount name, data/<mount>, @converter with its @, a host bind's absolute path, deployment or app for the metadata trees, or vault_secrets, port_mappings, host_mappings or deployment_config for the records the archive carries beside its data; a subject this archive does not carry is refused before anything is stopped or replayed --runtime string target runtime (docker|podman) --secrets-password stringArray candidate password to decrypt the backup's secrets (repeatable; tried after this cluster's vault master). Honoured on --id and --file alike --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, overriding the context's; the deployment must already exist. To bring one up from an archive use shc install <app> --from-backup <archive> --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 promptsOptions inherited from parent commands
Section titled “Options inherited from parent commands” --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) -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") --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)SEE ALSO
Section titled “SEE ALSO”- shc backup - create and manage backups