Promote a migration

Promoting a migration

In the case of continuous migrations, you can initiate the promotion process once it is time to move reads and writes to the destination. In a one-time migration, the Cloud SQLinstance is ready as soon as dump/load is complete, and user-invoked promotion is not required.

Promotion means that the destination Cloud SQL instance is disconnected from the source, and is promoted from a replica instance to a primary instance.

The process for performing a loss-less promotion is:

  1. Go to the Migration jobs page.
  2. After the full dump phase has completed and the migration job is in CDC phase, the option for promotion is available.
  3. Immediately after transitioning to the CDC phase, depending on the size of the dump, there may be a long replication delay as the Cloud SQL destination instance catches up on changes that occurred during the dump and load.

    Wait for the replication delay to trend down significantly, ideally on the order of minutes or seconds. The replication delay is available for review on the migration job page.

  4. After the replication delay is at a minimum, you can initiate the promotion. To avoid data loss, make sure to:
    1. Stop all writes, running scripts and client connections to the source database. The downtime period begins here.
    2. Wait until the replication delay is at zero, which means that the migration job has processed all outstanding changes.
    3. Click Promote on the migration job.

  5. 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.
  6. The destination instance is promoted to a primary writeable instance. The migration job status is Completed.
  7. The application can now be connected to the Cloud SQL instance and the migration job can be safely deleted.

Migration 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.