File: //snap/google-cloud-cli/current/help/man/man1/gcloud_alpha_sql_export_sql.1
.TH "GCLOUD_ALPHA_SQL_EXPORT_SQL" 1
.SH "NAME"
.HP
gcloud alpha sql export sql \- exports data from a Cloud SQL instance to a SQL file
.SH "SYNOPSIS"
.HP
\f5gcloud alpha sql export sql\fR \fIINSTANCE\fR \fIURI\fR [\fB\-\-async\fR] [\fB\-\-clean\fR] [\fB\-\-database\fR=\fIDATABASE\fR,[\fIDATABASE\fR,...],\ \fB\-d\fR\ \fIDATABASE\fR,[\fIDATABASE\fR,...]] [\fB\-\-if\-exists\fR] [\fB\-\-offload\fR] [\fB\-\-parallel\fR] [\fB\-\-table\fR=\fITABLE\fR,[\fITABLE\fR,...],\ \fB\-t\fR\ \fITABLE\fR,[\fITABLE\fR,...]] [\fB\-\-threads\fR=\fITHREADS\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Exports data from a Cloud SQL instance to a Google Cloud Storage
bucket as a SQL dump file.
NOTE: Certain roles and permissions are required to export data to Google Cloud
Storage. For more information on exporting data from Google Cloud SQL see Export
from Cloud SQL to a SQL dump file
(https://cloud.google.com/sql/docs/mysql/import\-export/import\-export\-sql#gcloud).
.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. If the filename ends with .gz, the contents are compressed.
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\fB\-\-clean\fR
Include SQL statements (DROP <object>) required to drop database objects prior
to import; corresponds to the clean flag for pg_dump. Only applies to PostgreSQL
non\-parallel exports.
.TP 2m
\fB\-\-database\fR=\fIDATABASE\fR,[\fIDATABASE\fR,...], \fB\-d\fR \fIDATABASE\fR,[\fIDATABASE\fR,...]
Database(s) from which the export is made. Information on requirements can be
found here:
https://cloud.google.com/sql/docs/mysql/admin\-api/v1beta4/instances/export#exportContext.databases
.TP 2m
\fB\-\-if\-exists\fR
Include an SQL statement (IF EXISTS) with each drop statement produced by the
clean flag; corresponds to the if\-exists flag for pg_dump. Only applies to
PostgreSQL non\-parallel exports.
.TP 2m
\fB\-\-offload\fR
Offload an export to a temporary instance. Doing so reduces strain on source
instances and allows other operations to be performed while the export is in
progress.
.TP 2m
\fB\-\-parallel\fR
Perform a parallel export. This flag is only applicable to MySQL and Postgres.
.TP 2m
\fB\-\-table\fR=\fITABLE\fR,[\fITABLE\fR,...], \fB\-t\fR \fITABLE\fR,[\fITABLE\fR,...]
Tables to export from the specified database. If you specify tables, specify one
and only one database. For PostgreSQL instances, only one table can be exported
at a time.
.TP 2m
\fB\-\-threads\fR=\fITHREADS\fR
Specifies the number of threads to use for the parallel export. If
\f5\-\-parallel\fR is specified and this flag is not provided, Cloud SQL uses a
default thread count to optimize performance.
.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 export sql
.RE
.RS 2m
$ gcloud beta sql export sql
.RE