gcloud alloydb clusters export Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alloydb clusters export - export data from an AlloyDB cluster to Google Cloud Storage
- SYNOPSIS
gcloud alloydb clusters exportCLUSTER--database=DATABASE--gcs-uri=GCS_URI--region=REGION([--csv--select-query=SELECT_QUERY:--escape-character=ESCAPE_CHARACTER--field-delimiter=FIELD_DELIMITER--quote-character=QUOTE_CHARACTER] | [--sql:--schema-only--tables=TABLES[--clean-target-objects:--if-exist-target-objects]])[--async][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- Export data from an AlloyDB cluster to Google Cloud Storage.
- EXAMPLES
- To export a cluster, run:
gcloudalloydbclustersexportmy-cluster--region=us-central1--database=my-database--gcs-uri=gs://my-bucket/my-export-file-path--csv--select-query="SELECT * FROM my-table" - POSITIONAL ARGUMENTS
CLUSTER- AlloyDB cluster ID
- REQUIRED FLAGS
--database=DATABASE- Database name.
- Destination URI where the file needs to be exported.
This must be specified.
--gcs-uri=GCS_URI- Path to the Google Cloud Storage file to which export has to be done.
--region=REGION- Regional location (e.g.
asia-east1,us-east1). See thefull list of regions athttps://cloud.google.com/sql/docs/instance-locations. - Export options for the cluster.
Exactly one of these must be specified:
- CSV export options for the cluster.
--csv- Specifies destination file type.
This flag argument must be specified if any of the other arguments in this groupare specified.
--select-query=SELECT_QUERY- Select query to be used for export.
This flag argument must be specified if any of the other arguments in this groupare specified.
--escape-character=ESCAPE_CHARACTER- Escape character to be used for export.
--field-delimiter=FIELD_DELIMITER- Field delimiter to be used for export.
--quote-character=QUOTE_CHARACTER- Quote character to be used for export.
- SQL export options for the cluster.
--sql- Specifies destination file type.
This flag argument must be specified if any of the other arguments in this groupare specified.
--schema-only- Export only schema of the database.
--tables=TABLES- Comma-separated list of table names which need to be exported.
- SQL export options to clean target objects.
--clean-target-objects- If true, output commands to DROP all the dumped database objects prior tooutputting the commands for creating them.
This flag argument must be specified if any of the other arguments in this groupare specified.
--if-exist-target-objects- If true, use DROP … IF EXISTS commands to check for the object'sexistence before dropping it in clean_target_objects mode.
- OPTIONAL FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
- 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 helpfor details. - NOTES
- These variants are also available:
gcloudalphaalloydbclustersexportgcloudbetaalloydbclustersexport
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-21 UTC.