HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/help/man/man1/gcloud_alpha_sql_import_bak.1
.TH "GCLOUD_ALPHA_SQL_IMPORT_BAK" 1



.SH "NAME"
.HP
gcloud alpha sql import bak \- import data into a Cloud SQL instance from a BAK file



.SH "SYNOPSIS"
.HP
\f5gcloud alpha sql import bak\fR \fIINSTANCE\fR [\fIURI\fR] \fB\-\-database\fR=\fIDATABASE\fR, \fB\-d\fR \fIDATABASE\fR [\fB\-\-async\fR] [\fB\-\-bak\-type\fR=\fIBAK_TYPE\fR;\ default="FULL"] [\fB\-\-keep\-encrypted\fR] [\fB\-\-no\-recovery\fR] [\fB\-\-recovery\-only\fR] [\fB\-\-stop\-at\fR=\fISTOP_AT\fR] [\fB\-\-stop\-at\-mark\fR=\fISTOP_AT_MARK\fR] [\fB\-\-[no\-]striped\fR] [\fB\-\-cert\-path\fR=\fICERT_PATH\fR\ \fB\-\-pvk\-path\fR=\fIPVK_PATH\fR\ (\fB\-\-prompt\-for\-pvk\-password\fR\ |\ \fB\-\-pvk\-password\fR=\fIPVK_PASSWORD\fR)] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(ALPHA)\fR 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



.SH "EXAMPLES"

To import data from the BAK file \f5my\-bucket/my\-export.bak\fR into the
database \f5my\-database\fR in the Cloud SQL instance \f5my\-instance\fR, run:

.RS 2m
$ gcloud alpha sql import bak my\-instance \e
    gs://my\-bucket/my\-export.bak \-\-database=my\-database
.RE

To import data from the encrypted BAK file \f5my\-bucket/my\-export.bak\fR into
the database \f5my\-database\fR in the Cloud SQL instance \f5my\-instance\fR,
with the certificate \f5gs://my\-bucket/my\-cert.crt\fR, private key
\f5gs://my\-bucket/my\-key.key\fR and prompting for the private key password,
run:

.RS 2m
$ gcloud alpha sql import bak my\-instance \e
    gs://my\-bucket/my\-export.bak \-\-database=my\-database \e
    \-\-cert\-path=gs://my\-bucket/my\-cert.crt \e
    \-\-pvk\-path=gs://my\-bucket/my\-key.key \-\-prompt\-for\-pvk\-password
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
\fIINSTANCE\fR

Cloud SQL instance ID.

.TP 2m
[\fIURI\fR]

Path to the BAK file file in Google Cloud Storage from which the import is made.
The URI is in the form \f5gs://bucketName/fileName\fR.


.RE
.sp

.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m
\fB\-\-database\fR=\fIDATABASE\fR, \fB\-d\fR \fIDATABASE\fR

A new database into which the import is made.


.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\-\-bak\-type\fR=\fIBAK_TYPE\fR; default="FULL"

Type of bak file that will be imported. Applicable to SQL Server only.
\fIBAK_TYPE\fR must be one of: \fBFULL\fR, \fBDIFF\fR, \fBTLOG\fR.

.TP 2m
\fB\-\-keep\-encrypted\fR

Whether or not to decrypt the imported encrypted BAK file.

.TP 2m
\fB\-\-no\-recovery\fR

Whether or not the SQL Server import is execueted with NORECOVERY keyword.

.TP 2m
\fB\-\-recovery\-only\fR

Whether or not the SQL Server import skip download and bring database online.

.TP 2m
\fB\-\-stop\-at\fR=\fISTOP_AT\fR

Equivalent to SQL Server STOPAT keyword. Used in transaction log import only.
Transaction log import stop at this timestamp. Format: YYYY\-MM\-DDTHH:MM:SS.

.TP 2m
\fB\-\-stop\-at\-mark\fR=\fISTOP_AT_MARK\fR

Equivalent to SQL Server STOPATMARK keyword. Used in transaction log import
only. Transaction log import stop at the given mark. To stop at given LSN, use
\-\-stop\-at\-mark=lsn:xxx.

.TP 2m
\fB\-\-[no\-]striped\fR

Whether SQL Server import should be striped. Use \fB\-\-striped\fR to enable and
\fB\-\-no\-striped\fR to disable.

.TP 2m

Encryption info to support importing an encrypted .bak file


.RS 2m
.TP 2m
\fB\-\-cert\-path\fR=\fICERT_PATH\fR

Path to the encryption certificate file in Google Cloud Storage associated with
the BAK file. The URI is in the form \f5gs://bucketName/fileName\fR.

This flag argument must be specified if any of the other arguments in this group
are specified.

.TP 2m
\fB\-\-pvk\-path\fR=\fIPVK_PATH\fR

Path to the encryption private key file in Google Cloud Storage associated with
the BAK file. The URI is in the form \f5gs://bucketName/fileName\fR.

This flag argument must be specified if any of the other arguments in this group
are specified.

.TP 2m

Exactly one of these must be specified:


.RS 2m
.TP 2m
\fB\-\-prompt\-for\-pvk\-password\fR

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.

.TP 2m
\fB\-\-pvk\-password\fR=\fIPVK_PASSWORD\fR

The private key password associated with the BAK file.


.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 sql import bak
.RE

.RS 2m
$ gcloud beta sql import bak
.RE