La promotion signifie que l'instance Cloud SQL de destination est déconnectée de la source et qu'elle passe d'une instance répliquée à une instance principale.
Pour les migrations continues, vous pouvez lancer le processus de promotion une fois qu'il est temps de déplacer les lectures et les écritures vers la destination.
Pour les migrations ponctuelles, l'instance Cloud SQL est prête dès que le vidage et le chargement sont terminés, et la promotion déclenchée par l'utilisateur n'est pas requise.
Pour promouvoir une migration sans perte d'informations, procédez comme suit:
Cliquez sur le job de migration que vous souhaitez promouvoir. La page Informations sur le job de migration s'affiche.
Une fois la phase de vidage complet terminée et que la tâche de migration est en phase de CDC, l'option de promotion est disponible.
Immédiatement après la transition vers la phase CDC, en fonction de la taille du dump, un long délai de réplication peut être observé, car l'instance de destination Cloud SQL rattrape les modifications qui ont eu lieu lors du dump et de la charge.
Attendez que le délai de réplication diminue de manière significative, idéalement de l'ordre de minutes ou de secondes. Le délai de réplication est disponible sur la page de la tâche de migration.
Une fois le délai de réplication minimal atteint, vous pouvez lancer la promotion.
Pour éviter de perdre des données, assurez-vous de :
Arrêtez toutes les écritures, les scripts en cours d'exécution et les connexions client à la base de données source. C'est ici que commence la période d'arrêt.
Attendez que le délai de réplication soit nul, ce qui signifie que la tâche de migration a traité toutes les modifications en attente.
Sur la page Informations sur le job de migration, cliquez sur Promouvoir.
Dans la fenêtre Promote migration job? (Promouvoir le job de migration ?), cliquez sur Promote (Promouvoir).
La tâche de migration arrête la lecture à partir de la source et le sous-état est Promote in progress. À ce stade, vous ne pouvez pas arrêter ni annuler le processus de promotion.
L'instance de destination est promue en instance principale avec accès en écriture.
L'état de la tâche de migration est Completed.
L'application peut désormais être connectée à l'instance Cloud SQL, et la tâche de migration peut être supprimée en toute sécurité.
Les comportements suivants peuvent se produire lors d'une promotion:
Lorsque vous promouvez des jobs de migration qui ont échoué ou ont été arrêtés manuellement pendant la phase CDC, les données de la source et de la destination peuvent être incohérentes.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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."]]