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_sql_export_bak.1
.TH "GCLOUD_SQL_EXPORT_BAK" 1



.SH "NAME"
.HP
gcloud sql export bak \- export data from a Cloud SQL instance to a BAK file



.SH "SYNOPSIS"
.HP
\f5gcloud sql export bak\fR \fIINSTANCE\fR \fIURI\fR \fB\-\-database\fR=\fIDATABASE\fR,[\fIDATABASE\fR,...], \fB\-d\fR \fIDATABASE\fR,[\fIDATABASE\fR,...] [\fB\-\-async\fR] [\fB\-\-bak\-type\fR=\fIBAK_TYPE\fR;\ default="FULL"] [\fB\-\-differential\-base\fR] [\fB\-\-export\-log\-end\-time\fR=\fIEXPORT_LOG_END_TIME\fR] [\fB\-\-export\-log\-start\-time\fR=\fIEXPORT_LOG_START_TIME\fR] [\fB\-\-stripe_count\fR=\fISTRIPE_COUNT\fR] [\fB\-\-[no\-]striped\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

Export data from a Cloud SQL instance to a Google Cloud Storage bucket as a BAK
backup file. This is only supported for SQL Server.



.SH "EXAMPLES"

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

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



.SH "POSITIONAL ARGUMENTS"

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

Cloud SQL instance ID.

.TP 2m
\fIURI\fR

The path to the file in Google Cloud Storage where the export will be stored.
The URI is in the form gs://bucketName/fileName. If the file already exists, the
operation fails.


.RE
.sp

.SH "REQUIRED FLAGS"

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

Database from which the export is made. Information on requirements can be found
here:
https://cloud.google.com/sql/docs/sqlserver/admin\-api/v1beta4/instances/export#exportContext.databases


.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 exported, FULL or DIFF. SQL Server only.
\fIBAK_TYPE\fR must be one of: \fBFULL\fR, \fBDIFF\fR, \fBTLOG\fR.

.TP 2m
\fB\-\-differential\-base\fR

Whether the bak file export can be used as differential base for future
differential backup. SQL Server only

.TP 2m
\fB\-\-export\-log\-end\-time\fR=\fIEXPORT_LOG_END_TIME\fR

Optional flag. The end time of the transaction log files that are included in
the export file. Use this flag to export transaction logs for Cloud SQL for SQL
Server only. Format: YYYY\-MM\-DDTHH:MM:SSZ, UTC timezone only.

.TP 2m
\fB\-\-export\-log\-start\-time\fR=\fIEXPORT_LOG_START_TIME\fR

Optional flag. The start time of the transaction log files that are included in
the export file. Use this flag to export transaction logs for Cloud SQL for SQL
Server only. Format: YYYY\-MM\-DDTHH:MM:SSZ, UTC timezone only.

.TP 2m
\fB\-\-stripe_count\fR=\fISTRIPE_COUNT\fR

Specifies the number of stripes to use for SQL Server exports.

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

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


.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"

These variants are also available:

.RS 2m
$ gcloud alpha sql export bak
.RE

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