shc backup
shc backup create
Section titled “shc backup create”Create a backup of a stack:
shc backup create --stack nextcloudshc backup create --stack nextcloud --file ./myapp.bakshc backup create --stack nextcloud --with-dependantsshc backup create --stack nextcloud --all-connectedshc backup ls
Section titled “shc backup ls”List backups:
shc backup lsshc backup ls --stack nextcloudshc backup ls --output jsonFor browsing backups stored in the Restic repository, use
shc backup ls (above) and filter by --stack / --id. To inspect a
local .bak / .bkg file’s manifest, see shc backup inspect
below.
shc backup restore
Section titled “shc backup restore”Restore data to an existing stack:
shc backup restore --file /tmp/myapp.bakshc backup restore --file /tmp/myapp.bak --stack myappshc backup restore --id abc123 --stack myapp
# Time-based restore (relative intervals only)shc backup restore --stack myapp --before "2h" # 2 hours agoshc backup restore --stack myapp --before "1d" # 1 day agoshc backup restore --stack myapp --before "30m" # 30 minutes ago
# Restore with connected stacksshc backup restore --id abc123 --with-connected # Same consistency_idshc backup restore --id abc123 --with-dependants # Stack and dependantsshc backup export
Section titled “shc backup export”Export backups from Restic repository to portable .bak or .bkg files:
# Single backup -> .bak fileshc backup export --id abc123 --file /tmp/myapp.bak
# Multiple backups -> .bkg group fileshc backup export --id abc123 --id def456 --file /tmp/backups.bkg
# Export with related backupsshc backup export --stack myapp --latest --with-connected --file /tmp/group.bkg
# Export all backups from a stackshc backup export --stack myapp --file /tmp/shc backup import
Section titled “shc backup import”Import .bak or .bkg files into Restic repository:
shc backup import --file /tmp/myapp.bakshc -t other-org backup import --file /tmp/myapp.bak # Import into different tenantshc backup import --file /tmp/backups.bkg # Uses manifests for placementshc backup import --file /tmp/myapp.bak --dry-run # Preview without importingshc backup verify
Section titled “shc backup verify”Confirm a backup’s snapshot still exists in its repository (a membership check — it does not scan the snapshot’s contents for corruption):
shc backup verify --id abc123shc backup verify --file /tmp/myapp.bakshc backup rm
Section titled “shc backup rm”Delete a backup:
shc backup rm --id abc123shc backup rm --id abc123 --forceshc backup export —export-environment
Section titled “shc backup export —export-environment”Filter exports by environment:
shc backup export --stack myapp --export-environment prod --file /tmp/prod.bakshc backup group
Section titled “shc backup group”Create a .bkg (backup group) file from multiple .bak files:
shc backup group -b app.bak -b db.bak --out combined.bkgshc backup group -b app.bak -b db.bak -b cache.bak --out /tmp/full-system.bkgshc backup ungroup
Section titled “shc backup ungroup”Extract .bak files from a .bkg group file:
shc backup ungroup -i combined.bkg --out /tmp/extracted/shc backup inspect
Section titled “shc backup inspect”Display manifest information from .bak or .bkg files:
# Inspect a single backupshc backup inspect myapp.bak
# Inspect a backup groupshc backup inspect combined.bkg
# Output formatsshc backup inspect myapp.bak --output jsonshc backup inspect myapp.bak --output yamlshc backup inspect myapp.bak --output tableshc recover
Section titled “shc recover”Create new deployments from backup files (top-level command):
# Single .bak file (using -f / --file)shc recover -f myapp.bak
# Single .bkg group file (using -f / --file, auto-expands to individual .bak files)shc recover -f combined.bkg
# Multiple .bak files (using -b / --from-backup)shc recover -b myapp.bak -b mydb.bakshc recover -b myapp.bak:newapp -b mydb.bak:newdb
# From .bkg group file (using -b)shc recover -b combined.bkgshc recover -b combined.bkg --rename oldapp:newapp --rename olddb:newdb
# Target environment and nodeshc recover -f myapp.bak -e prod -n node-abc123
# Relocate specific stacks to specific nodesshc recover -b combined.bkg --relocate myapp:node-2 --relocate mydb:node-3
# Skip integrations during recoveryshc recover -b combined.bkg --skip-integration traefik
# Override stack properties during recoveryshc recover -b combined.bkg --override myapp:stack=myapp-restored,node=node-2
# Dry run (preview without executing)shc recover -b combined.bkg --dry-runshc backup sync
Section titled “shc backup sync”Synchronize backup metadata with the Restic repository:
shc backup syncshc backup sync --stack myappRolling back to a safety snapshot
Section titled “Rolling back to a safety snapshot”Install, update, and restore each take an automatic pre_* safety
snapshot before changing a deployment (skip with --no-rollback).
Restore one — or any point in time — with shc backup restore --before:
shc backup restore --stack myapp --before "2h" # ~2 hours agoshc backup restore --stack myapp --before "1d" # ~1 day agoshc backup restore --stack myapp --before "2026-01-05" # Specific date