이 문서에서는 Cloud Shell에서 Spanner 마이그레이션 도구(SMT)를 설치하고 실행하는 방법을 설명합니다. SMT에 대한 자세한 내용은 Spanner 마이그레이션 도구를 참고하세요.
시작하기 전에
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.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-03(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)."]]