For continuous migrations, you can initiate the promotion process after it's time to move reads and writes to the destination databases. Promotion means that the migrated Cloud SQL databases become now accessible for all read and write operations.
To promote a migration job, follow these steps:
- Initiate the 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.
- Make sure that all the available data from transaction log files is
replicated to the Cloud SQL for SQL Server destination instance.
You can achieve this result by performing one of the following actions:
- Stop your automated backup file uploads, or upload the last transaction log file. Monitor the unprocessed transaction log backups size to determine when Database Migration Service finishes processing that file.
- Optionally, you can upload a transaction log file whose name ends
in
.trn.final
suffix. Database Migration Service stops continuous loads when it detects a backup file whose name matches the.trn.final
suffix convention.When Database Migration Service finishes processing that file, migration job status changes to Ready to promote.
- Perform the promote action on the migration job.
Console
- In the Google Cloud console, go to the Migration jobs page.
- In the Jobs tab, click the display name of the migration job
that you want to promote.
The migration job details page opens.
- Click Promote.
- In the dialog box, click Promote.
gcloud
Before using any of the command data below, make the following replacements:
- MIGRATION_JOB_ID with
your migration job identifier.
If you don't know the identifier, you can use the
gcloud database-migration migration-jobs list
command to list all migration jobs in a given region and view their identifiers. - REGION with the identifier of the region where your connection profile is saved.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloud database-migration migration-jobs \ promote MIGRATION_JOB_ID \ --region=REGION
Windows (PowerShell)
gcloud database-migration migration-jobs ` promote MIGRATION_JOB_ID ` --region=REGION
Windows (cmd.exe)
gcloud database-migration migration-jobs ^ promote MIGRATION_JOB_ID ^ --region=REGION
Result
The action is performed in an asynchronous manner. As such, this command returns an Operation entity that represents a long-running operation:
done: false metadata: '@type': type.googleapis.com/google.cloud.clouddms.v1.OperationMetadata apiVersion: v1 createTime: '2024-02-20T12:20:24.493106418Z' requestedCancellation: false target: MIGRATION_JOB_ID verb: start name: OPERATION_ID
- Use the
gcloud database-migration migration-jobs describe
command to view the status of the migration job. - Use the
gcloud database-migration operations describe
with the OPERATION_ID to see the status of the operation itself.
- The destination instance is promoted, and your migrated databases
are now accessible for all read and write operations.
The migration job status changes to
Completed
. - The application can now be connected to the Cloud SQL instance and the migration job can be safely deleted.