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/396/help/man/man1/gcloud_alpha_spanner_migrate_schema.1
.TH "GCLOUD_ALPHA_SPANNER_MIGRATE_SCHEMA" 1



.SH "NAME"
.HP
gcloud alpha spanner migrate schema \- migrate schema from a source database to Cloud Spanner



.SH "SYNOPSIS"
.HP
\f5gcloud alpha spanner migrate schema\fR \fB\-\-source\fR=\fISOURCE\fR \fB\-\-target\-profile\fR=\fITARGET_PROFILE\fR [\fB\-\-dry\-run\fR] [\fB\-\-log\-level\fR=\fILOG_LEVEL\fR] [\fB\-\-prefix\fR=\fIPREFIX\fR] [\fB\-\-project\fR=\fIPROJECT\fR] [\fB\-\-source\-profile\fR=\fISOURCE_PROFILE\fR] [\fB\-\-target\fR=\fITARGET\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(ALPHA)\fR Migrate schema from a source database to Cloud Spanner.



.SH "EXAMPLES"

To generate schema file from the source database:

.RS 2m
$ gcloud alpha spanner migrate schema \-\-source=postgresql < \e
    ~/cart.pg_dump
.RE



.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m
\fB\-\-source\fR=\fISOURCE\fR

Flag for specifying source database (e.g., PostgreSQL, MySQL, DynamoDB).

.TP 2m
\fB\-\-target\-profile\fR=\fITARGET_PROFILE\fR

Flag for specifying connection profile for target database (e.g.,
"dialect=postgresql)".


.RE
.sp

.SH "OPTIONAL FLAGS"

.RS 2m
.TP 2m
\fB\-\-dry\-run\fR

Flag for generating DDL and schema conversion report without creating a Cloud
Spanner database.

.TP 2m
\fB\-\-log\-level\fR=\fILOG_LEVEL\fR

To configure the log level for the execution (INFO, VERBOSE).

.TP 2m
\fB\-\-prefix\fR=\fIPREFIX\fR

File prefix for generated files.

.TP 2m
\fB\-\-project\fR=\fIPROJECT\fR

The project in which the migration job and its resources will be created.

.TP 2m
\fB\-\-source\-profile\fR=\fISOURCE_PROFILE\fR

Flag for specifying connection profile for source database (e.g.,
"file=<path>,format=dump").

.TP 2m
\fB\-\-target\fR=\fITARGET\fR

Specifies the target database, defaults to Spanner (accepted values: Spanner)
(default "Spanner").


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