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_data.1
.TH "GCLOUD_ALPHA_SPANNER_MIGRATE_DATA" 1



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



.SH "SYNOPSIS"
.HP
\f5gcloud alpha spanner migrate data\fR \fB\-\-session\fR=\fISESSION\fR \fB\-\-source\fR=\fISOURCE\fR \fB\-\-target\-profile\fR=\fITARGET_PROFILE\fR [\fB\-\-dataflow\-template\fR=\fIDATAFLOW_TEMPLATE\fR] [\fB\-\-dry\-run\fR] [\fB\-\-log\-level\fR=\fILOG_LEVEL\fR] [\fB\-\-prefix\fR=\fIPREFIX\fR] [\fB\-\-project\fR=\fIPROJECT\fR] [\fB\-\-skip\-foreign\-keys\fR] [\fB\-\-source\-profile\fR=\fISOURCE_PROFILE\fR] [\fB\-\-target\fR=\fITARGET\fR] [\fB\-\-write\-limit\fR=\fIWRITE_LIMIT\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

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



.SH "EXAMPLES"

To copy data to Cloud Spanner given a session file:

.RS 2m
$ gcloud alpha spanner migrate data \-\-session=./session.json \e
    \-\-source=postgresql < ~/cart.pg_dump \e
    \-\-target\-profile='instance=spanner\-instance'
.RE



.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m
\fB\-\-session\fR=\fISESSION\fR

Specifies the file that you restore session state from.

.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\-\-dataflow\-template\fR=\fIDATAFLOW_TEMPLATE\fR

The google cloud storage path of the minimal downtime migration template to use
to run the migration job.

.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\-\-skip\-foreign\-keys\fR

Skip creating foreign keys after data migration is complete.

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

.TP 2m
\fB\-\-write\-limit\fR=\fIWRITE_LIMIT\fR

Number of parallel writers to Cloud Spanner during bulk data migrations (default
40).


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