Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dokumen ini menjelaskan cara menginstal dan menjalankan alat migrasi Spanner (SMT) di Cloud Shell. Untuk mengetahui informasi selengkapnya tentang SMT, lihat Alat migrasi Spanner.
Sebelum memulai
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.
Untuk meluncurkan UI web SMT, Anda dapat menjalankan
perintah berikut:
gcloud alpha spanner migrate web
Anda harus memberikan kredensial Google Cloud untuk mengizinkan
SMT mengakses resource. Klik
http://localhost:8080 pada respons perintah sebelumnya untuk membuka UI web.
Menghubungkan ke Spanner
Untuk terhubung ke Spanner menggunakan UI web SMT, lakukan langkah berikut:
Klik tombol edit
untuk mengonfigurasi koneksi ke Spanner.
Tentukan informasi berikut untuk terhubung ke Spanner:
Project ID: project ID tempat instance Spanner Anda berada.
Instance ID: ID instance Spanner.
Klik Simpan.
Menghubungkan ke database sumber
Anda harus terhubung ke database sumber menggunakan UI web SMT dengan memberikan informasi berikut:
Mesin Database: tentukan apakah database sumber Anda adalah MySQL, SQL Server,
Oracle, atau PostgreSQL.
Nama host: alamat IP database sumber Anda.
Port: port tempat database sumber Anda dapat diakses.
Nama pengguna: nama pengguna database sumber.
Sandi: sandi database sumber.
Dialek Spanner: tentukan apakah Anda ingin menggunakan
GoogleSQL
atau PostgreSQL.
Setelah memasukkan informasi, Anda dapat terhubung ke database sumber dengan
mengklik Uji Koneksi, lalu mengklik Hubungkan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-25 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)."]]