For continuous migrations, finalize the migration job when you want to start using your destination cluster 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 cluster.
To finalize a migration, do the following:
Go to Migration jobs in the Google Cloud console.
Click the migration job that represents the migration that you want to finalize. The migration job details page appears.
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 job details page.
After the replication delay is at a minimum, prepare for promotion. To avoid data loss, make sure to:
Stop all writes, running scripts, and client connections to the source database. The downtime period begins here.
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.
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 AlloyDB for PostgreSQL destination to clean up all the temporary migration data. This process can take several minutes.
When the promotion process is complete, the migration job status changes to Completed.
You can now connect your application to the destination AlloyDB for PostgreSQL instance and safely delete the migration job.