Stay organized with collections
Save and categorize content based on your preferences.
This document describes how to install and run the Spanner
migration tool (SMT) on Cloud Shell. For more information about SMT,
see Spanner migration tool.
Before you begin
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
To launch the SMT web UI, you can run the
following command:
gcloud alpha spanner migrate web
You need to provide your Google Cloud credentials to allow
SMT to access resources. Click
http://localhost:8080 on the response to the previous command to open the web
UI.
Connect to Spanner
To connect to Spanner using the SMT web UI, do the following:
Click the edit button
to configure the connection to Spanner.
Specify the following information to connect to Spanner:
Project ID: the project ID where your Spanner instance is.
Instance ID: the Spanner instance ID.
Click Save.
Connect to your source database
You need to connect to the source database using the SMT
web UI by providing the following information:
Database Engine: specify whether your source database is MySQL, SQL Server,
Oracle, or PostgreSQL.
Hostname: the IP address of your source database.
Port: the port where your source database is accessible.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[],[],null,["# Set up Spanner migration tool\n\nThis document describes how to install and run the Spanner\nmigration tool (SMT) on Cloud Shell. For more information about SMT,\nsee [Spanner migration tool](https://googlecloudplatform.github.io/spanner-migration-tool/).\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n1. [Install](/sdk/docs/install) the Google Cloud CLI.\n2. To initialize the Google Cloud CLI, run the `gcloud init` command.\n\nInstall Spanner migration tool\n------------------------------\n\nYou can install SMT using a Linux shell command or Google Cloud CLI: \n\n### Linux shell\n\nTo install SMT, run the following command: \n\n sudo apt-get install google-cloud-sdk-spanner-migration-tool\n\n### gcloud\n\nYou can install SMT by using the\n[`gcloud components install`](/sdk/gcloud/reference/components/install)\ncommand: \n\n gcloud components install spanner-migration-tool\n\nFor more information on installing SMT, see\n[Installing Spanner migration tool](https://googlecloudplatform.github.io/spanner-migration-tool/install.html#installing-spanner-migration-tool).\n\nAccess Spanner migration tool\n-----------------------------\n\nYou can use the\n[`gcloud alpha spanner migrate`](/sdk/gcloud/reference/alpha/spanner/migrate)\ncommand to access and use SMT.\n\nTo launch the SMT web UI, you can run the\nfollowing command: \n\n gcloud alpha spanner migrate web\n\nYou need to provide your Google Cloud credentials to allow\nSMT to access resources. Click\n`http://localhost:8080` on the response to the previous command to open the web\nUI.\n| **Note:** Keep the Google Cloud CLI tab open while you view the SMT web UI.\n\nConnect to Spanner\n------------------\n\nTo connect to Spanner using the SMT web UI, do the following:\n\n1. Click the edit button\n to configure the connection to Spanner.\n\n2. Specify the following information to connect to Spanner:\n\n - **Project ID**: the project ID where your Spanner instance is.\n - **Instance ID**: the Spanner instance ID.\n3. Click **Save**.\n\nConnect to your source database\n-------------------------------\n\nYou need to connect to the source database using the SMT\nweb UI by providing the following information:\n\n- **Database Engine**: specify whether your source database is MySQL, SQL Server, Oracle, or PostgreSQL.\n- **Hostname**: the IP address of your source database.\n- **Port**: the port where your source database is accessible.\n- **User name**: the username of the source database.\n- **Password**: the password of the source database.\n- **Spanner Dialect** : specify whether you want to use [GoogleSQL](/spanner/docs/reference/standard-sql/overview) or [PostgreSQL](/spanner/docs/reference/postgresql/overview).\n\nAfter entering the information you can connect to the source database by\nclicking **Test Connection** , and then clicking **Connect**.\n\nWhat's next?\n------------\n\n- [Migrate schema from MySQL](/spanner/docs/migrate-mysql-schema).\n- [Use Spanner migration tool for MySQL schema migration](/spanner/docs/migrate-schema-from-mysql-using-migration-tool)."]]