File: //snap/google-cloud-cli/current/help/man/man1/gcloud_alpha_spanner_databases_restore.1
.TH "GCLOUD_ALPHA_SPANNER_DATABASES_RESTORE" 1
.SH "NAME"
.HP
gcloud alpha spanner databases restore \- restore a Cloud Spanner database
.SH "SYNOPSIS"
.HP
\f5gcloud alpha spanner databases restore\fR (\fB\-\-destination\-database\fR=\fIDESTINATION_DATABASE\fR\ :\ \fB\-\-destination\-instance\fR=\fIDESTINATION_INSTANCE\fR) (\fB\-\-source\-backup\fR=\fISOURCE_BACKUP\fR\ :\ \fB\-\-source\-instance\fR=\fISOURCE_INSTANCE\fR) [\fB\-\-async\fR] [\fB\-\-encryption\-type\fR=\fIENCRYPTION_TYPE\fR\ \fB\-\-kms\-keys\fR=[\fIKMS_KEYS\fR,...]\ |\ [\fB\-\-kms\-key\fR=\fIKMS_KEY\fR\ :\ \fB\-\-kms\-keyring\fR=\fIKMS_KEYRING\fR\ \fB\-\-kms\-location\fR=\fIKMS_LOCATION\fR\ \fB\-\-kms\-project\fR=\fIKMS_PROJECT\fR]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Restores from a backup to a new Cloud Spanner database.
.SH "EXAMPLES"
To restore a backup, run:
.RS 2m
$ gcloud alpha spanner databases restore \-\-source\-backup=BACKUP_ID \e
\-\-source\-instance=SOURCE_INSTANCE \e
\-\-destination\-database=DATABASE \e
\-\-destination\-instance=INSTANCE_NAME
.RE
To restore a backup using relative names, run:
.RS 2m
$ gcloud alpha spanner databases restore \e
\-\-source\-backup=projects/PROJECT_ID/instances/\e
SOURCE_INSTANCE_ID/backups/BACKUP_ID \e
\-\-destination\-database=projects/PROJECT_ID/instances/\e
SOURCE_INSTANCE_ID/databases/DATABASE_ID
.RE
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
Database resource \- TEXT The arguments in this group can be used to specify the
attributes of this resource. (NOTE) Some attributes are not given arguments in
this group but can be set in other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-destination\-database\fR on the command line with a
fully specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fB\-\-destination\-database\fR=\fIDESTINATION_DATABASE\fR
ID of the database or fully qualified identifier for the database.
To set the \f5database\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-destination\-database\fR on the command line.
.RE
.sp
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-destination\-instance\fR=\fIDESTINATION_INSTANCE\fR
The Cloud Spanner instance for the database.
To set the \f5instance\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-destination\-database\fR on the command line with a
fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-destination\-instance\fR on the command line;
.IP "\(bu" 2m
set the property \f5spanner/instance\fR.
.RE
.sp
.RE
.sp
.TP 2m
Backup resource \- TEXT The arguments in this group can be used to specify the
attributes of this resource. (NOTE) Some attributes are not given arguments in
this group but can be set in other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-source\-backup\fR on the command line with a fully
specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fB\-\-source\-backup\fR=\fISOURCE_BACKUP\fR
ID of the backup or fully qualified identifier for the backup.
To set the \f5backup\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-source\-backup\fR on the command line.
.RE
.sp
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-source\-instance\fR=\fISOURCE_INSTANCE\fR
The Cloud Spanner instance for the backup.
To set the \f5instance\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-source\-backup\fR on the command line with a fully
specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-source\-instance\fR on the command line;
.IP "\(bu" 2m
set the property \f5spanner/instance\fR.
.RE
.sp
.RE
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\fB\-\-encryption\-type\fR=\fIENCRYPTION_TYPE\fR
The encryption type of the restored database. \fIENCRYPTION_TYPE\fR must be one
of:
.RS 2m
.TP 2m
\fBcustomer\-managed\-encryption\fR
Use the provided Cloud KMS key for encryption. If this option is selected,
kms\-key must be set.
.TP 2m
\fBgoogle\-default\-encryption\fR
Use Google default encryption.
.TP 2m
\fBuse\-config\-default\-or\-backup\-encryption\fR
Use the default encryption configuration if one exists, otherwise use the same
encryption configuration as the backup.
.RE
.sp
.TP 2m
KMS key name group
At most one of these can be specified:
.RS 2m
.TP 2m
Key resource \- Cloud KMS key(s) to be used to restore the Cloud Spanner
database. This represents a Cloud resource. (NOTE) Some attributes are not given
arguments in this group but can be set in other ways.
To set the \f5kms\-project\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-kms\-keys\fR on the command line with a fully
specified name.
.RE
.sp
To set the \f5kms\-location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-kms\-keys\fR on the command line with a fully
specified name.
.RE
.sp
To set the \f5kms\-keyring\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-kms\-keys\fR on the command line with a fully
specified name.
.RE
.sp
.RS 2m
.TP 2m
\fB\-\-kms\-keys\fR=[\fIKMS_KEYS\fR,...]
IDs of the keys or fully qualified identifiers for the keys.
To set the \f5kms\-key\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-kms\-keys\fR on the command line.
.RE
.sp
.RE
.sp
.TP 2m
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.
.RS 2m
.TP 2m
\fB\-\-kms\-key\fR=\fIKMS_KEY\fR
ID of the key or fully qualified identifier for the key.
To set the \f5kms\-key\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-kms\-key\fR on the command line.
.RE
.sp
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-kms\-keyring\fR=\fIKMS_KEYRING\fR
KMS keyring id of the key.
To set the \f5kms\-keyring\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-kms\-key\fR on the command line with a fully
specified name;
.IP "\(em" 2m
provide the argument \f5\-\-kms\-keyring\fR on the command line.
.RE
.sp
.TP 2m
\fB\-\-kms\-location\fR=\fIKMS_LOCATION\fR
Cloud location for the key.
To set the \f5kms\-location\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-kms\-key\fR on the command line with a fully
specified name;
.IP "\(em" 2m
provide the argument \f5\-\-kms\-location\fR on the command line.
.RE
.sp
.TP 2m
\fB\-\-kms\-project\fR=\fIKMS_PROJECT\fR
Cloud project id for the key.
To set the \f5kms\-project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-kms\-key\fR on the command line with a fully
specified name;
.IP "\(em" 2m
provide the argument \f5\-\-kms\-project\fR on the command line.
.RE
.sp
.RE
.RE
.RE
.sp
.SH "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 \fB$ gcloud help\fR for details.
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:
.RS 2m
$ gcloud spanner databases restore
.RE
.RS 2m
$ gcloud beta spanner databases restore
.RE