Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo documento descrive come installare ed eseguire lo strumento di migrazione Spanner (SMT) in Cloud Shell. Per saperne di più su SMT,
consulta Strumento di migrazione di Spanner.
Prima di iniziare
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.
Per avviare la UI web di SMT, puoi eseguire il
seguente comando:
gcloud alpha spanner migrate web
Devi fornire le tue credenziali Google Cloud per consentire
a SMT di accedere alle risorse. Fai clic su
http://localhost:8080 nella risposta al comando precedente per aprire la GUI web.
Connettiti a Spanner
Per connetterti a Spanner utilizzando l'interfaccia utente web SMT:
Fai clic sul pulsante di modifica
per configurare la connessione a Spanner.
Specifica le seguenti informazioni per connetterti a Spanner:
ID progetto: l'ID progetto in cui si trova l'istanza Spanner.
ID istanza: l'ID istanza Spanner.
Fai clic su Salva.
Connettiti al database di origine
Devi connetterti al database di origine utilizzando l'interfaccia utente web SMT fornendo le seguenti informazioni:
Motore del database: specifica se il database di origine è MySQL, SQL Server,
Oracle o PostgreSQL.
Nome host: l'indirizzo IP del database di origine.
Porta: la porta in cui è accessibile il database di origine.
Nome utente: il nome utente del database di origine.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 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)."]]