gcloud alpha sql export bak Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha sql export bak - export data from a Cloud SQL instance to a BAK file
- SYNOPSIS
gcloud alpha sql export bakINSTANCEURI--database=DATABASE,[DATABASE,…],-dDATABASE,[DATABASE,…][--async][--bak-type=BAK_TYPE; default="FULL"][--differential-base][--export-log-end-time=EXPORT_LOG_END_TIME][--export-log-start-time=EXPORT_LOG_START_TIME][--stripe_count=STRIPE_COUNT][--[no-]striped][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Export data from a Cloud SQL instance to a Google CloudStorage bucket as a BAK backup file. This is only supported for SQL Server.- EXAMPLES
- To export data from the database
my-databasein the Cloud SQLinstancemy-instanceto a BAK filemy-bucket/my-export.bak, run:gcloudalphasqlexportbakmy-instancegs://my-bucket/my-export.bak--database=my-database - POSITIONAL ARGUMENTS
INSTANCE- Cloud SQL instance ID.
URI- 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, theoperation fails.
- REQUIRED FLAGS
--database=DATABASE,[DATABASE,…],-dDATABASE,[DATABASE,…]- Database from which the export is made. Information on requirements can be foundhere:https://cloud.google.com/sql/docs/sqlserver/admin-api/v1beta4/instances/export#exportContext.databases
- OPTIONAL FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
--bak-type=BAK_TYPE; default="FULL"- Type of bak file that will be exported, FULL or DIFF. SQL Server only.
BAK_TYPEmust be one of:FULL,DIFF,TLOG. --differential-base- Whether the bak file export can be used as differential base for futuredifferential backup. SQL Server only
--export-log-end-time=EXPORT_LOG_END_TIME- Optional flag. The end time of the transaction log files that are included inthe export file. Use this flag to export transaction logs for Cloud SQL for SQLServer only. Format: YYYY-MM-DDTHH:MM:SSZ, UTC timezone only.
--export-log-start-time=EXPORT_LOG_START_TIME- Optional flag. The start time of the transaction log files that are included inthe export file. Use this flag to export transaction logs for Cloud SQL for SQLServer only. Format: YYYY-MM-DDTHH:MM:SSZ, UTC timezone only.
--stripe_count=STRIPE_COUNT- Specifies the number of stripes to use for SQL Server exports.
--[no-]striped- Whether SQL Server export should be striped. Use
--stripedtoenable and--no-stripedto disable.
- 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
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudsqlexportbakgcloudbetasqlexportbak
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 2025-05-07 UTC.