CLI reference
Backups CLI command reference
Reference documentation for the sanity backups CLI command.
This is a paid feature
This feature is available on certain Enterprise plans. Talk to sales to learn more.
This is reference documentation for the CLI's backups command. If you're new to the backup feature, check out our getting started guide.
npx sanity backups --help
pnpm dlx sanity backups --help
yarn dlx sanity backups --help
bunx sanity backups --help
Commands
disable
USAGE
$ sanity backups disable [DATASET] [-p <id>]
ARGUMENTS
[DATASET] Dataset name to disable backup for
OVERRIDE FLAGS
-p, --project-id=<id> Project ID to disable backups for (overrides CLI configuration)
DESCRIPTION
Disable backup for a dataset.
EXAMPLES
Interactively disable backup for a dataset
$ sanity backups disable
Disable backup for the production dataset
$ sanity backups disable productiondownload
USAGE
$ sanity backups download [DATASET] [-p <id>] [--backup-id <value>] [--concurrency <value>] [--out <value>] [--overwrite]
ARGUMENTS
[DATASET] Dataset name to download backup from
FLAGS
--backup-id=<value> The backup ID to download
--concurrency=<value> Concurrent number of backup item downloads (max: 24)
--out=<value> The file or directory path the backup should download to
--overwrite Allows overwriting of existing backup file
OVERRIDE FLAGS
-p, --project-id=<id> Project ID to download backup from (overrides CLI configuration)
DESCRIPTION
Download a dataset backup to a local file.
EXAMPLES
Interactively download a backup
$ sanity backups download
Download a specific backup for the production dataset
$ sanity backups download production --backup-id 2024-01-01-backup-1
Download backup to a specific file
$ sanity backups download production --backup-id 2024-01-01-backup-2 --out /path/to/file
Download backup and overwrite existing file
$ sanity backups download production --backup-id 2024-01-01-backup-3 --out /path/to/file --overwriteenable
USAGE
$ sanity backups enable [DATASET] [-p <id>]
ARGUMENTS
[DATASET] Dataset name to enable backup for
OVERRIDE FLAGS
-p, --project-id=<id> Project ID to enable backups for (overrides CLI configuration)
DESCRIPTION
Enable backup for a dataset.
EXAMPLES
Interactively enable backup for a dataset
$ sanity backups enable
Enable backup for the production dataset
$ sanity backups enable productionlist
USAGE
$ sanity backups list [DATASET] [-l <value>] [-p <id>] [--after <value>] [--before <value>]
ARGUMENTS
[DATASET] Dataset name to list backups for
FLAGS
-l, --limit=<value> Maximum number of backups returned
--after=<value> Only return backups after this date (inclusive, YYYY-MM-DD format)
--before=<value> Only return backups before this date (exclusive, YYYY-MM-DD format)
OVERRIDE FLAGS
-p, --project-id=<id> Project ID to list backups for (overrides CLI configuration)
DESCRIPTION
List available backups for a dataset.
EXAMPLES
List backups for a dataset interactively
$ sanity backups list
List backups for the production dataset
$ sanity backups list production
List up to 50 backups for the production dataset
$ sanity backups list production --limit 50
List up to 10 backups created after 2024-01-31
$ sanity backups list production --after 2024-01-31 --limit 10