1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-08 10:35:03 +00:00
gcloud-help/gcloud/spanner/databases/restore

165 lines
6.1 KiB
Text
Raw Normal View History

2022-03-01 04:29:52 +00:00
NAME
gcloud spanner databases restore - restore a Cloud Spanner database
SYNOPSIS
gcloud spanner databases restore
(--destination-database=DESTINATION_DATABASE
: --destination-instance=DESTINATION_INSTANCE)
(--source-backup=SOURCE_BACKUP : --source-instance=SOURCE_INSTANCE)
[--async]
[--encryption-type=ENCRYPTION_TYPE [--kms-key=KMS_KEY
: --kms-keyring=KMS_KEYRING
--kms-location=KMS_LOCATION --kms-project=KMS_PROJECT]]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
Restores from a backup to a new Cloud Spanner database.
EXAMPLES
To restore a backup, run:
$ gcloud spanner databases restore --source-backup=BACKUP_ID \
--source-instance=SOURCE_INSTANCE \
--destination-database=DATABASE \
--destination-instance=INSTANCE_NAME
To restore a backup using relative names, run:
$ gcloud spanner databases restore \
--source-backup=projects/PROJECT_ID/instances/\
SOURCE_INSTANCE_ID/backups/BACKUP_ID \
--destination-database=projects/PROJECT_ID/instances/\
SOURCE_INSTANCE_ID/databases/DATABASE_ID
REQUIRED FLAGS
Database resource - TEXT The arguments in this group can be used to
specify the attributes of this resource. (NOTE) Some attributes are not
2023-05-04 10:43:54 +00:00
given arguments in this group but can be set in other ways.
To set the project attribute:
2022-03-01 04:29:52 +00:00
◆ provide the argument --destination-database on the command line with
a fully specified name;
◆ provide the argument --project on the command line;
◆ set the property core/project.
This must be specified.
--destination-database=DESTINATION_DATABASE
2023-05-04 10:43:54 +00:00
ID of the database or fully qualified identifier for the database.
To set the database attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --destination-database on the command line.
2022-08-10 08:48:58 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2022-03-01 04:29:52 +00:00
--destination-instance=DESTINATION_INSTANCE
2023-05-04 10:43:54 +00:00
The Cloud Spanner instance for the database.
To set the instance attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --destination-database on the command line
with a fully specified name;
▸ provide the argument --destination-instance on the command line;
▸ set the property spanner/instance.
Backup resource - TEXT The arguments in this group can be used to specify
the attributes of this resource. (NOTE) Some attributes are not given
2023-05-04 10:43:54 +00:00
arguments in this group but can be set in other ways.
To set the project attribute:
2022-03-01 04:29:52 +00:00
◆ provide the argument --source-backup on the command line with a fully
specified name;
◆ provide the argument --project on the command line;
◆ set the property core/project.
This must be specified.
--source-backup=SOURCE_BACKUP
2023-05-04 10:43:54 +00:00
ID of the backup or fully qualified identifier for the backup.
To set the backup attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --source-backup on the command line.
2022-08-10 08:48:58 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2022-03-01 04:29:52 +00:00
--source-instance=SOURCE_INSTANCE
2023-05-04 10:43:54 +00:00
The Cloud Spanner instance for the backup.
To set the instance attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --source-backup on the command line with a
fully specified name;
▸ provide the argument --source-instance on the command line;
▸ set the property spanner/instance.
OPTIONAL FLAGS
--async
Return immediately, without waiting for the operation in progress to
complete.
--encryption-type=ENCRYPTION_TYPE
The encryption type of the restored database. ENCRYPTION_TYPE must be
one of:
customer-managed-encryption
Use the provided Cloud KMS key for encryption. If this option is
selected, kms-key must be set.
google-default-encryption
Use Google default encryption.
use-config-default-or-backup-encryption
Use the default encryption configuration if one exists, otherwise
use the same encryption configuration as the backup.
Key resource - Cloud KMS key to be used to restore the Cloud Spanner
database. The arguments in this group can be used to specify the
attributes of this resource.
--kms-key=KMS_KEY
2023-05-04 10:43:54 +00:00
ID of the key or fully qualified identifier for the key.
To set the kms-key attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --kms-key on the command line.
2022-08-10 08:48:58 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2022-03-01 04:29:52 +00:00
--kms-keyring=KMS_KEYRING
2023-05-04 10:43:54 +00:00
KMS keyring id of the key.
To set the kms-keyring attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --kms-key on the command line with a fully
specified name;
▸ provide the argument --kms-keyring on the command line.
--kms-location=KMS_LOCATION
2023-05-04 10:43:54 +00:00
Cloud location for the key.
To set the kms-location attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --kms-key on the command line with a fully
specified name;
▸ provide the argument --kms-location on the command line.
--kms-project=KMS_PROJECT
2023-05-04 10:43:54 +00:00
Cloud project id for the key.
To set the kms-project attribute:
2022-03-01 04:29:52 +00:00
▸ provide the argument --kms-key on the command line with a fully
specified name;
▸ provide the argument --kms-project on the command line.
GCLOUD WIDE FLAGS
These flags are available to all commands: --access-token-file, --account,
--billing-project, --configuration, --flags-file, --flatten, --format,
--help, --impersonate-service-account, --log-http, --project, --quiet,
--trace-token, --user-output-enabled, --verbosity.
Run $ gcloud help for details.
NOTES
These variants are also available:
$ gcloud alpha spanner databases restore
$ gcloud beta spanner databases restore