Finalize a migration

For continuous migrations, finalize the migration job when you want to start using your destination instance for your application.

You can use the Promote button on the migration job details page to have Database Migration Service clean up all the temporary migration data and promote your destination instance.

To finalize a migration, do the following:

  1. Go to the Migration jobs page in the Google Cloud Console.

    Go to the Migration jobs page

  2. Click the migration job that represents the migration that you want to finalize. The Migration job details page appears.

  3. Use the Data Validation Tool to track the replication delay by checking row counts.

    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 jobs page.

  4. After the replication delay is at a minimum, initiate the cut over. 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.

    You can finalize 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.

    1. On the migration job details page, click Promote, and then confirm the action in the Promote migration job? window.

    The migration job stops reading from your source database. Database Migration Service promotes your Cloud SQL for PostgreSQL destination instance to clean up all the temporary migration data. This process can take several minutes.

  5. When the promotion process is complete, the migration job status changes to Completed.

  6. You can now connect your application to the destination Cloud SQL for PostgreSQL instance and safely delete the migration job.