La promozione indica che l'istanza Cloud SQL di destinazione viene disconnessa dall'origine e viene promossa da un'istanza replica a un'istanza principale.
Per le migrazioni continue, puoi avviare la procedura di promozione
quando è il momento di spostare le letture e le scritture nella destinazione.
Per le migrazioni una tantum, l'istanza Cloud SQL è pronta non appena il dump e il caricamento sono stati completati e la promozione invocata dall'utente non è necessaria.
Per eseguire una migrazione senza perdita di informazioni:
Fai clic sul job di migrazione che rappresenta la migrazione da promuovere. Viene visualizzata la pagina Dettagli job di migrazione.
Una volta completata la fase di dump completo e il job di migrazione è in fase di CDC, l'opzione di promozione è disponibile.
Immediatamente dopo la transizione alla fase CDC, a seconda delle dimensioni del dump, potrebbe verificarsi un lungo ritardo nella replica perché l'istanza di destinazione Cloud SQL si aggiorna sulle modifiche apportate durante il dump e il caricamento.
Attendi che il ritardo di replica tenda a diminuire in modo significativo, idealmente nell'ordine di minuti o secondi. Il ritardo nella replica è disponibile per la revisione nella pagina del job di migrazione.
Quando il ritardo nella replica è minimo, puoi avviare la promozione.
Per evitare la perdita di dati, assicurati di:
Interrompi tutte le scritture, gli script in esecuzione e le connessioni client al database di origine. Inizia il periodo di tempo di riposo.
Attendi che il ritardo di replica sia pari a zero, il che significa che il
job di migrazione ha elaborato tutte le modifiche in sospeso.
Nella pagina Dettagli job di migrazione, fai clic su Esegui promozione.
Nella finestra Promuovere il job di migrazione?, fai clic su Promuovi.
Il job di migrazione interrompe la lettura dall'origine e lo stato secondario è Promote in progress. A questo punto, non puoi interrompere o annullare la procedura di promozione.
L'istanza di destinazione viene promossa a istanza principale scrivibile.
Lo stato del job di migrazione è Completed.
Ora l'applicazione può essere collegata all'istanza Cloud SQL e il job di migrazione può essere eliminato in sicurezza.
Durante una promozione possono verificarsi i seguenti comportamenti:
Quando promuovi job di migrazione che non sono riusciti o sono stati interrotti manualmente durante la fase CDC, i dati di origine e di destinazione possono essere incoerenti.
La promozione abilita il recupero point-in-time (PITR) sulle istanze migrate, il che può prolungare il completamento della procedura di promozione.
[[["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\u003ePromotion disconnects the destination Cloud SQL instance from the source, transforming it from a replica to a primary instance.\u003c/p\u003e\n"],["\u003cp\u003eFor continuous migrations, promotion should occur after shifting reads and writes to the destination, while one-time migrations are ready for use immediately after the dump and load process is complete.\u003c/p\u003e\n"],["\u003cp\u003eTo prevent data loss, halt all writes to the source database and confirm the replication delay is at zero before initiating promotion.\u003c/p\u003e\n"],["\u003cp\u003eDuring promotion, the migration job ceases reading from the source, and once completed, the destination instance becomes the primary, writeable instance.\u003c/p\u003e\n"],["\u003cp\u003ePromoting failed or manually stopped migration jobs in the CDC phase can lead to data inconsistencies between the source and destination databases.\u003c/p\u003e\n"]]],[],null,["# Promote a migration\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nMySQL \\| [PostgreSQL](/database-migration/docs/postgres/promote-migration \"View this page for the PostgreSQL version of Database Migration Service.\") \\| [PostgreSQL to AlloyDB](/database-migration/docs/postgresql-to-alloydb/promote-migration \"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\n\u003cbr /\u003e\n\n\nPromotion means that the destination Cloud SQL instance is disconnected from\nthe source, and is promoted from a replica instance to a primary instance.\n\n\nFor continuous migrations, you can initiate the promotion process\nafter it's time to move reads and writes to the destination.\nFor one-time migrations, the Cloud SQL instance is ready as soon as the dump and load is complete, and user-invoked promotion isn't required.\n\nTo promote a migration without loss of information, follow these steps:\n\n1. Go to the [Migration jobs](https://console.cloud.google.com/dbmigration/migrations) page.\n2. Click the migration job that represents the migration that you want to promote. The **Migration job details** page appears.\n\n3. After the full dump phase has completed and the migration job is in CDC phase, the option for promotion is available.\n4. Immediately after transitioning to the CDC phase, depending on the size of the dump, there may be a long replication delay because the Cloud SQL destination instance catches up on changes that occurred during the dump and\n load.\n\n Wait for the replication delay to trend down significantly, ideally on the\n order of minutes or seconds. The replication delay is available for review on\n the migration job page.\n5. After the replication delay is at a minimum, you can initiate the promotion. To avoid data loss, make sure to:\n 1. **Stop all writes, running scripts, and client connections to the source\n database**. The downtime period begins here.\n 2. Wait until the replication delay is at zero, which means that the migration job has processed all outstanding changes.\n\n | You can promote a migration even if the replication delay isn't at zero. This can reduce the database downtime, but may affect the accuracy of the data in the destination.\n6. In the **Migration job details** page, click **Promote**.\n7. In the **Promote migration job?** window, click **Promote**.\n8. The migration job stops reading from the source and the substatus is `Promote in progress`. At this point, you cannot stop or undo the promotion process.\n9. The destination instance is promoted to a primary writeable instance. The migration job status is `Completed`.\n10. The application can now be connected to the Cloud SQL instance and the migration job can be safely deleted.\n\nThe following behaviors can occur during a promotion:\n\n\u003cbr /\u003e\n\n- When you promote migration jobs that have failed or were manually stopped during CDC phase, data on the source and the destination can be inconsistent.\n- Promotion enables [point-in-time recovery (PITR)](/sql/docs/mysql/backup-recovery/restore#tips-pitr) on migrated instances, which can take the promotion process longer to complete."]]