Sysdig Platform CLI - Backup Restore

This section explains concepts and notations in the set of the backup restore commands provided.

Usage

The Restore option writes to a file all the information from the supported sections, or from a particular section, if it’s specified.

$ sdc-cli backup restore --help                  
Usage: sdc-cli backup restore [OPTIONS] BACKUP_FILE [SECTION]...

  BACKUP_PATH: File where the data must be restored from.

  SECTION: Restore only the specified section. Valid values: dashboards,
  notification_channels, alerts, users, teams_monitor, teams_secure, policies,
  falco_rules, falco_lists, falco_macros, scanning_alerts.

Options:
  --full       Drop and restore everything from the sections specified. If not
               specified only items that are different in the backup than in
               the remote will be restored.
  --all-users  Restore dashboards even if you are not the owner (may duplicate
               the dashboards if they already exist in the environment)
  --help       Show this message and exit.

The Restore option is non-destructive by default, so in order to remove existing information from the platform, and restore the backup to a clean state, you must specify --full.

By default the only dashboards that will be restored are the same ones that match, the user that’s restoring the backup, so no dashboards from other users are restored and duplicated by accident. If you want to restore dashboards from all users, maybe because you are performing a migration between zones, you will need to specify --all-users.

Example: Restore Monitor only

The following command will restore from the monitor.yaml file all the Dashboards from all users, Notification Channels, Alerts and Teams in Monitor.

$ sdc-cli backup restore monitor.yaml dashboards notification_channels alerts teams_monitor --all-users

Example: Restore Secure only, cleaning the existing information

The following command will restore from the secure.yaml file all the Teams in Secure, Runtime Policies, Falco Rules, Falco Lists and Falco Macros, first removing existing information in the environment.

$ sdc-cli backup restore secure.yaml teams_secure policies falco_rules falco_lists falco_macros --full

Example: Restore everything

The following command will restore a backup.yaml file with all the information in the platform, first destroying existing information, if any:

$ sdc-cli backup restore backup.yaml --full --all-users