Quando esegui la migrazione di schema, dati e metadati da un database di origine a un database di destinazione, devi assicurarti che tutte queste informazioni vengano migrate in modo accurato. Database Migration Service offre un modo ad alta fedeltà per eseguire la migrazione degli oggetti di database (inclusi schema, dati e metadati) da un database all'altro.
Nell'ambito della migrazione del database viene eseguita la migrazione di tutti i seguenti componenti di dati, schema e metadati:
Dati
Tutte le tabelle di tutti i database e schemi, esclusi i seguenti database di sistema: sys, mysql, performance_schema e information_schema.
Schema
Denominazione
Chiave primaria
Tipo di dati
Posizione ordinale
Valore predefinito
Supporto di valori Null
Attributi con incremento automatico
Indici secondari
Metadati
Stored procedure
Funzioni
Trigger
Visualizzazioni
Vincoli delle chiavi esterne
Migrazione continua
Le modifiche al linguaggio di manipolazione dei dati (DML) e al linguaggio di definizione dei dati (DDL) a tutti i dati, agli schemi e ai metadati sopra elencati vengono aggiornate durante le migrazioni continue.
Elementi di cui non viene eseguita la migrazione
Quando esegui la migrazione di un database MySQL, i database di sistema MySQL non vengono migrati. Questi database contengono informazioni su utenti e privilegi. Per questo motivo, i dati di accesso dell'account utente devono essere gestiti direttamente nell'istanza del database Cloud SQL di destinazione.
Per aggiungere utenti all'istanza di destinazione Cloud SQL, vai all'istanza e aggiungi gli utenti dalla scheda Utenti o dal client MySQL.
Oltre agli utenti e ai privilegi, le impostazioni dei flag non predefinite non vengono migrate all'istanza di destinazione Cloud SQL. Esegui
SHOW VARIABLES
sul database di origine prima di eseguire la migrazione di schema, dati e metadati nel database di destinazione, quindi eseguilo di nuovo sul database Cloud SQL. Aggiorna le impostazioni dei flag in base alle esigenze nel database Cloud SQL per
riprodurre le impostazioni dell'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."],[[["\u003cp\u003eDatabase Migration Service ensures accurate migration of database objects, including schema, data, and metadata, from one database to another.\u003c/p\u003e\n"],["\u003cp\u003eAll tables, excluding MySQL system databases such as \u003ccode\u003esys\u003c/code\u003e, \u003ccode\u003emysql\u003c/code\u003e, \u003ccode\u003eperformance_schema\u003c/code\u003e, and \u003ccode\u003einformation_schema\u003c/code\u003e, are migrated.\u003c/p\u003e\n"],["\u003cp\u003eSchema elements like naming, primary keys, data types, and metadata components such as stored procedures, functions, and triggers are all migrated.\u003c/p\u003e\n"],["\u003cp\u003eUser account login information and non-default flag settings are not migrated; they must be managed directly in the Cloud SQL destination instance.\u003c/p\u003e\n"],["\u003cp\u003eData manipulation language (DML) and data definition language (DDL) changes to data, schema, and metadata are continuously updated during ongoing migrations.\u003c/p\u003e\n"]]],[],null,["# Migration fidelity\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nMySQL \\| [PostgreSQL](/database-migration/docs/postgres/migration-fidelity \"View this page for the PostgreSQL version of Database Migration Service.\") \\| [PostgreSQL to AlloyDB](/database-migration/docs/postgresql-to-alloydb/migration-fidelity \"View this page for the PostgreSQL to AlloyDB version of Database Migration Service.\")\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nOverview\n--------\n\nWhen you're migrating your schema, data, and metadata from a source database to a\ndestination database, you want to ensure that all of this information is\nmigrated accurately. Database Migration Service provides a high-fidelity way to\nmigrate database objects (including the schema, data, and metadata) from one\ndatabase to another.\n\nAll of the following data, schema, and metadata components are migrated as part\nof the database migration:\n\n### Data\n\n- All tables from all databases and schemas, excluding the following system databases: `sys`, `mysql`, `performance_schema`, and `information_schema`.\n\n### Schema\n\n- Naming\n\n- Primary key\n\n- Data type\n\n- Ordinal position\n\n- Default value\n\n- Nullability\n\n- Auto-increment attributes\n\n- Secondary indexes\n\n### Metadata\n\n- Stored procedures\n\n- Functions\n\n- Triggers\n\n- Views\n\n- Foreign key constraints\n\n### Continuous migration\n\nData manipulation language (DML) and data definition language (DDL)\nchanges to all data, schemas, and metadata listed above are\nupdated during continuous migrations.\n\n### What isn't migrated\n\nWhen migrating a MySQL database, MySQL system databases aren't migrated. These databases contain information about users and privileges. Because of this, user account login information must be managed in the destination Cloud SQL database instance directly.\n\nTo add users to the Cloud SQL destination instance, navigate to the instance and add users from the **Users** tab, or add them from the MySQL client.\n\n[Learn more about creating and managing MySQL users](/sql/docs/mysql/create-manage-users).\n\nIn addition to users and privileges, non-default flag settings aren't migrated to the Cloud SQL destination instance. Run\n[\u003cvar translate=\"no\"\u003eSHOW VARIABLES\u003c/var\u003e](https://dev.mysql.com/doc/refman/8.0/en/show-variables.html)\non your source database before migrating your schema, data, and metadata to the\ndestination database, and then run it again on the Cloud SQL\ndatabase. Update flag settings as needed on the Cloud SQL database to\nreplicate the source settings.\n| **Note:** Some flags that apply to a primary database may not make sense on a replica. Also, not all MySQL flags are allowed on a Cloud SQL instance. Refer to the [Cloud SQL documentation](/sql/docs/mysql/flags) for more information."]]