ALTER BACKUP statement allows for new KMS encryption keys to be applied to an existing chain of encrypted backups ( and ). Each ALTER BACKUP statement must include the new KMS encryption key with NEW_KMS, and use WITH OLD_KMS to refer to at least one of the KMS URIs that were originally used to encrypt the backup.
After an ALTER BACKUP statement successfully completes, subsequent , , and statements can use any of the existing or new KMS URIs to decrypt the backup.
CockroachDB supports AWS, Azure, and Google Cloud KMS keys. For more detail on encrypted backups and restores, see .
Synopsis
Parameters
| Parameter | Description |
|---|---|
subdirectory | The subdirectory containing the target full backup at the given collectionURI. |
LATEST | The most recent backup at the given collectionURI. |
collectionURI | The URI that holds the backup collection. |
ADD NEW\_KMS | Apply the new KMS encryption key to the target backup. |
WITH OLD\_KMS | Reference one of the existing KMS URI(s) originally used to encrypt the backup. |
kmsURI | The for the KMS key. |
Required privileges
ALTER BACKUPcan only be run by members of the . By default, therootuser belongs to theadminrole.ALTER BACKUPrequires full read and write permissions to the target cloud storage bucket.
s3, azure, or gs with credentials. The backup collection’s URI does require the when using s3, azure, or gs with credentials.
We recommend using .
Examples
ALTER BACKUP will apply the new encryption information to the entire chain of backups ( and ).
When running
ALTER BACKUP with a subdirectory, the statement must point to a in the backup collection.Add an AWS KMS key to an encrypted backup
To add a new KMS key to the most recent backup:ALTER BACKUP statement that points to the full backup:
Add an Azure KMS key to an encrypted backup
To add a new KMS key to the most recent backup:ALTER BACKUP statement that points to the full backup:
Add a Google Cloud KMS key to an encrypted backup
To add a new KMS key to the most recent backup:ALTER BACKUP statement that points to the full backup:

