A promoção significa que a instância de destino do Cloud SQL é desconectada da
origem e é promovida de uma instância de réplica para uma principal.
Para migrações contínuas, é possível iniciar o processo de promoção
quando for hora de mover as leituras e gravações para o destino.
Para migrações únicas, a instância do Cloud SQL fica pronta assim que o despejo e a carga são concluídos,
e a promoção acionada pelo usuário não é necessária.
Para promover uma migração sem perda de informações, siga estas etapas:
Clique no job de migração que representa a migração que você quer promover. A página Detalhes do job de migração é exibida.
Depois que a fase de despejo completa for concluída e o job de migração estiver na fase de CDC, a opção de promoção estará disponível.
Imediatamente após a transição para a fase de CDC, dependendo do tamanho do despejo, pode haver um longo atraso na replicação porque a instância de destino do Cloud SQL acompanha as mudanças que ocorreram durante o despejo e a carga.
Aguarde o atraso da replicação diminuir significativamente, preferencialmente na
ordem de minutos ou segundos. O atraso de replicação está disponível para revisão na
página do job de migração.
Depois que o atraso da replicação estiver no mínimo, você poderá iniciar a promoção.
Para evitar a perda de dados, faça o seguinte:
Interrompa todas as gravações, scripts em execução e conexões de clientes no banco de dados de origem. O período de inatividade começa aqui.
Aguarde até que o atraso da replicação seja zero, o que significa que o job de migração processou todas as mudanças pendentes.
Na página Detalhes do job de migração, clique em Promover.
Na janela Promover job de migração?, clique em Promover.
O job de migração para de ler da origem, e o substatus é
Promote in progress. Nesse ponto, não é possível interromper ou desfazer o
processo de promoção.
A instância de destino é promovida a uma instância principal gravável.
O status do job de migração é Completed.
(Opcional) Para origens que usam a extensão pg_cron:
a extensão pg_cron (ou qualquer configuração cron associada a ela)
não é migrada pelo Database Migration Service, mas é aceita em
destinos do Cloud SQL para PostgreSQL. Se você usar a extensão pg_cron nos bancos de dados de origem, poderá reinstalá-la na instância de destino.
Agora o aplicativo pode ser conectado à instância do Cloud SQL, e o job de migração pode ser excluído com segurança.
Jobs de migração que falharam ou foram interrompidos manualmente durante a fase de CDC podem ser
promovidas, mas isso pode significar uma lacuna entre os dados na origem e no
destino.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-05 UTC."],[[["\u003cp\u003ePromotion of a migration job turns the destination Cloud SQL instance from a replica into a primary instance, disconnecting it from the source.\u003c/p\u003e\n"],["\u003cp\u003eFor continuous migrations, promotion should be initiated after the decision to switch reads and writes to the destination has been made, while one-time migrations are ready after the dump and load process completes.\u003c/p\u003e\n"],["\u003cp\u003eBefore promoting, it's crucial to stop all writes and connections to the source database and wait for the replication delay to reach zero to avoid data loss.\u003c/p\u003e\n"],["\u003cp\u003eThe promotion process can be initiated in the Migration job details page by clicking "Promote," and once started, it cannot be stopped or reversed.\u003c/p\u003e\n"],["\u003cp\u003eIf the \u003ccode\u003epg_cron\u003c/code\u003e extension is used in the source database, it is not migrated by Database Migration Service, but can be reinstalled on the destination instance after promotion.\u003c/p\u003e\n"]]],[],null,["# Promote a migration\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n[MySQL](/database-migration/docs/mysql/promote-migration \"View this page for the MySQL version of Database Migration Service.\") \\| PostgreSQL \\| [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. (Optional) **For sources that use the `pg_cron` extension** : The [`pg_cron`](/sql/docs/postgres/extensions#pg_cron) extension (or any `cron` settings associated with the extension) isn't migrated by Database Migration Service, but it is supported in Cloud SQL for PostgreSQL destinations. If you use the `pg_cron` extension in your source databases, you can re-install it on your destination instance.\n11. The application can now be connected to the Cloud SQL instance and the migration job can be safely deleted.\n\nMigration jobs that have failed or were manually stopped during CDC phase can be promoted, but this may mean a gap between the data on the source and the destination."]]