Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Pour les migrations continues, vous pouvez lancer le processus de promotion une fois qu'il est temps de transférer les lectures et les écritures vers les bases de données de destination.
La promotion signifie que les bases de données Cloud SQL migrées sont désormais accessibles pour toutes les opérations de lecture et d'écriture.
Vous pouvez promouvoir une tâche de migration ou des bases de données sélectionnées à partir d'une tâche de migration.
Lancez la promotion. Pour éviter toute perte de données, assurez-vous d'arrêter toutes les écritures, tous les scripts en cours d'exécution et toutes les connexions client à la base de données source.
La période de temps d'arrêt commence ici.
Assurez-vous que toutes les données disponibles des fichiers journaux des transactions sont répliquées vers l'instance de destination Cloud SQL pour SQL Server.
Pour ce faire, vous pouvez effectuer l'une des actions suivantes :
Vous pouvez éventuellement importer un fichier journal des transactions dont le nom se termine par le suffixe .trn.final. Database Migration Service arrête les chargements continus lorsqu'il détecte un fichier de sauvegarde dont le nom correspond à la convention de suffixe .trn.final.
Lorsque Database Migration Service a terminé de traiter ce fichier, l'état du job de migration passe à Prêt à être promu.
L'instance de destination ou les bases de données que vous avez sélectionnées sont promues, et vos bases de données migrées sont désormais accessibles pour toutes les opérations de lecture et d'écriture.
L'état de la tâche de migration passe à Completed.
L'application peut désormais être connectée à l'instance Cloud SQL, et la tâche de migration peut être supprimée sans risque.
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 in continuous migrations shifts read and write operations to the destination Cloud SQL databases, making them fully accessible.\u003c/p\u003e\n"],["\u003cp\u003eBefore initiating promotion, it's critical to halt all writes, scripts, and client connections to the source database to prevent data loss, marking the start of downtime.\u003c/p\u003e\n"],["\u003cp\u003eEnsure all transaction log data is replicated by either stopping automated uploads or uploading the final transaction log file with the \u003ccode\u003e.trn.final\u003c/code\u003e suffix, after which the job status will update to \u003ccode\u003eReady to promote\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003ePromotion can be performed on all databases within a migration job, or selectively on specific databases, through the Google Cloud console or via gcloud commands.\u003c/p\u003e\n"],["\u003cp\u003eAfter successful promotion, the migrated databases are ready for read/write operations, the migration job status updates to \u003ccode\u003eCompleted\u003c/code\u003e, and it can then be safely deleted.\u003c/p\u003e\n"]]],[],null,["# Promote a migration job\n\nFor continuous migrations, you can initiate the promotion process\nafter it's time to move reads and writes to the destination databases.\nPromotion means that the migrated Cloud SQL databases become now accessible\nfor all read and write operations.\n\nYou can promote a migration job or promote selected databases from a migration\njob.\n\n1. 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.\n2. 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:\n\n - Stop your [automated backup file uploads](/database-migration/docs/sqlserver/automate-backup-exports), or upload the last transaction log file. Monitor the [unprocessed transaction log backups size](/database-migration/docs/sqlserver/migration-job-metrics) to determine when Database Migration Service finishes processing that file.\n - 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](/database-migration/docs/sqlserver/export-backup-files).\n\n When Database Migration Service finishes processing that file, migration\n job status changes to\n [**Ready to promote**](/database-migration/docs/sqlserver/migration-job-statuses#ready-to-promote).\n3. Perform the promote action:\n\n ### Console\n\n 1. In the Google Cloud console, go to the **Migration jobs** page.\n\n [Go to Migration jobs](https://console.cloud.google.com/dbmigration/migrations)\n 2. On the **Jobs** tab, click the display name of the migration job that you want to promote.\n 3. The migration job details page opens.\n 4. Perform one of the following promote actions:\n - If you want to promote all databases included in the migration, on the migration job's toolbar, click **Promote**.\n\n The promote migration job dialog appears.\n - If you want to promote only specific databases, select them using the checkboxes next to the database names and on the **Databases** tab, click **Promote**.\n\n The dialog with a number of databases that you want to promote appears.\n 5. In the dialog, ensure that no errors are displayed, and then click **Promote**.\n\n ### gcloud\n\n\n Before using any of the command data below,\n make the following replacements:\n - \u003cvar class=\"edit\" scope=\"MIGRATION_JOB_ID\" translate=\"no\"\u003eMIGRATION_JOB_ID\u003c/var\u003e with your migration job identifier.\n\n If you don't know the identifier, you can use the\n [`gcloud database-migration migration-jobs list`](/sdk/gcloud/reference/database-migration/migration-jobs/list) command to list all\n migration jobs in a given region and view their identifiers.\n - \u003cvar class=\"edit\" scope=\"REGION\" translate=\"no\"\u003eREGION\u003c/var\u003e with the identifier of the region where your connection profile is saved.\n - Optional: Database Migration Service migrates all databases in your source by default. If you want to migrate only specific databases,\n use the `--databases-filter` flag and specify their identifiers as a comma-separated list.\n\n For example: `--databases-filter=my-business-database,my-other-database`\n\n You can later edit migration jobs that you created with the `--database-filter flag`\n by using the [`gcloud database-migration migration-jobs update`](/sdk/gcloud/reference/database-migration/migration-jobs/update) command.\n\n\n Execute the\n\n following\n\n command:\n\n #### Linux, macOS, or Cloud Shell\n\n **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n ```bash\n gcloud database-migration migration-jobs \\\n promote MIGRATION_JOB_ID \\\n --region=REGION\n ```\n\n #### Windows (PowerShell)\n\n **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n ```bash\n gcloud database-migration migration-jobs `\n promote MIGRATION_JOB_ID `\n --region=REGION\n ```\n\n #### Windows (cmd.exe)\n\n **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n ```bash\n gcloud database-migration migration-jobs ^\n promote MIGRATION_JOB_ID ^\n --region=REGION\n ```\n\n #### Result\n\n\n The action is performed in an asynchronous manner.\n As such, this command returns an\n [Operation entity](/database-migration/docs/reference/rest/v1/projects.locations.operations) that represents a long-running operation:\n\n ```\n done: false\n metadata:\n '@type': type.googleapis.com/google.cloud.clouddms.v1.OperationMetadata\n apiVersion: v1\n createTime: '2024-02-20T12:20:24.493106418Z'\n requestedCancellation: false\n target: MIGRATION_JOB_ID\n verb: start\n name: OPERATION_ID\n ```\n To see if your operation is successful, you can query the returned operation object, or check the status of the migration job:\n - Use the [`gcloud database-migration migration-jobs describe`](/sdk/gcloud/reference/database-migration/migration-jobs/describe) command to view the status of the migration job.\n - Use the [`gcloud database-migration operations describe`](/sdk/gcloud/reference/database-migration/operations/describe) with the \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e to see the status of the operation itself.\n4. The destination instance or the databases that you selected are promoted, and your migrated databases are now accessible for all read and write operations. The migration job status changes to `Completed`.\n5. The application can now be connected to the Cloud SQL instance and the migration job can be safely deleted."]]