1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-08 10:35:03 +00:00
gcloud-help/gcloud/alpha/sql/import/bak
2022-08-10 08:48:58 +00:00

98 lines
3.7 KiB
Text

NAME
gcloud alpha sql import bak - import data into a Cloud SQL instance from a
BAK file
SYNOPSIS
gcloud alpha sql import bak INSTANCE URI --database=DATABASE, -d DATABASE
[--async]
[--cert-path=CERT_PATH --pvk-path=PVK_PATH (--prompt-for-pvk-password
| --pvk-password=PVK_PASSWORD)] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) gcloud alpha sql import bak imports data into a Cloud SQL instance
from a BAK backup file in Google Cloud Storage. You should use a full
backup file with a single backup set.
For detailed help on importing data into Cloud SQL, refer to this guide:
https://cloud.google.com/sql/docs/sqlserver/import-export/importing
EXAMPLES
To import data from the BAK file my-bucket/my-export.bak into the database
my-database in the Cloud SQL instance my-instance, run:
$ gcloud alpha sql import bak my-instance \
gs://my-bucket/my-export.bak --database=my-database
To import data from the encrypted BAK file my-bucket/my-export.bak into the
database my-database in the Cloud SQL instance my-instance, with the
certificate gs://my-bucket/my-cert.crt, private key
gs://my-bucket/my-key.key and prompting for the private key password, run:
$ gcloud alpha sql import bak my-instance \
gs://my-bucket/my-export.bak --database=my-database \
--cert-path=gs://my-bucket/my-cert.crt \
--pvk-path=gs://my-bucket/my-key.key --prompt-for-pvk-password
POSITIONAL ARGUMENTS
INSTANCE
Cloud SQL instance ID.
URI
Path to the BAK file file in Google Cloud Storage from which the import
is made. The URI is in the form gs://bucketName/fileName.
REQUIRED FLAGS
--database=DATABASE, -d DATABASE
A new database into which the import is made.
OPTIONAL FLAGS
--async
Return immediately, without waiting for the operation in progress to
complete.
Encryption info to support importing an encrypted .bak file
--cert-path=CERT_PATH
Path to the encryption certificate file in Google Cloud Storage
associated with the BAK file. The URI is in the form
gs://bucketName/fileName.
This flag argument must be specified if any of the other arguments in
this group are specified.
--pvk-path=PVK_PATH
Path to the encryption private key file in Google Cloud Storage
associated with the BAK file. The URI is in the form
gs://bucketName/fileName.
This flag argument must be specified if any of the other arguments in
this group are specified.
Exactly one of these must be specified:
--prompt-for-pvk-password
Prompt for the private key password associated with the BAK file
with character echo disabled. The password is all typed characters
up to but not including the RETURN or ENTER key.
--pvk-password=PVK_PASSWORD
The private key password associated with the BAK file.
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
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:
$ gcloud sql import bak
$ gcloud beta sql import bak