Migrate your SQL Server databases to Cloud SQL for SQL Server
Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to migrate your SQL Server databases to
Cloud SQL for SQL Server instance with Database Migration Service.
The migration process involves the following tasks:
Exporting full database backup, and transaction
log files from the source SQL Server instance.
You can also use the optional differential database backup in your migration
process.
Uploading your backup files to a Cloud Storage bucket.
Creating the destination Cloud SQL for SQL Server instance.
Creating and running the migration job in Database Migration Service.
Monitoring the migration job progress with Database Migration Service observability
features.
Promoting the migration job after the data is fully migrated.
Costs
For homogenous migrations to Cloud SQL, Database Migration Service is offered
at no additional charge. However, Cloud SQL and Cloud Storage pricing
applies for network charges as well as Cloud SQL and Cloud Storage
entities created for migration purposes.
In this document, you use the following billable components of
Google Cloud:
Cloud Storage
Cloud SQL
To generate a cost estimate based on your projected usage, use the
pricing calculator.
Consider in which region you want to create the destination database.
Database Migration Service is a fully-regional product, meaning all entities
related to your migration (source and destination connection profiles,
migration jobs, destination databases, storage buckets) must be saved in a
single region.
To get the permissions that you need to perform homogeneous SQL Server
migrations with Database Migration Service, ask your administrator to grant the
required IAM roles on your project for the following
accounts involved in the migration process
For more information about granting roles, see
Manage access.
These predefined roles contain the permissions required to perform homogeneous
SQL Server migrations with Database Migration Service. To see the exact permissions
that are required, expand the Required permissions section:
Required permissions
The following permissions are required to perform homogeneous SQL Server
migrations with Database Migration Service:
To prepare your source data for migration, follow these steps:
Consider your backup strategy for the migration process.
Database Migration Service supports using a differential backup and the transaction log
files for migrating data that appears in your database after you take the full
backup.
When you start the migration job, your destination Cloud SQL for SQL Server
databases are put into recovery mode where they are fully managed by
Database Migration Service. You can promote your destination instance
when your data is fully migrated. After your destination instance is promoted,
all the databases in that instance become fully operational. You also gain
full write access to those databases.
You can monitor the migration progress, as well as your destination instance
health with Database Migration Service observability
features. See
Migration job metrics.
Keep uploading new transaction log backup files to the Cloud Storage bucket.
To cover data that appears in your source database after you perform
the full backup export,
export transaction log backup files and upload them to
the storage bucket. Database Migration Service automatically detects new files,
reads their contents, and pushes the data to your destination instance.
See
Automate transaction log exports.
Finalize the migration
When you decide to switch your application to the new Cloud SQL for SQL Server
instance, finalize the migration by following these steps:
Stop all write operations on your source databases. You can switch them
to read-only mode to retain operational functionality.
Take the last transaction log backup, upload the file to your storage
bucket, and stop the incremental load phase in Database Migration Service.
You can achieve this result by performing one of the following actions:
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis guide outlines the process of migrating SQL Server databases to Cloud SQL for SQL Server using Database Migration Service, involving exporting backups, uploading them to Cloud Storage, creating a destination instance, and running a migration job.\u003c/p\u003e\n"],["\u003cp\u003eThe migration process requires specific IAM roles for both the user account performing the migration and the Database Migration Service account, such as Database Migration Admin, Storage Admin, and Cloud SQL Editor, to ensure proper permissions.\u003c/p\u003e\n"],["\u003cp\u003ePreparing for the migration involves performing full backups of the source SQL Server database, configuring a Cloud Storage bucket for backup files, and establishing connection profiles for both the source and destination.\u003c/p\u003e\n"],["\u003cp\u003eDatabase Migration Service offers cost-effective homogenous migrations at no additional charge, but users should be aware of the costs associated with Cloud SQL and Cloud Storage usage, as well as potential network charges.\u003c/p\u003e\n"],["\u003cp\u003eFinalizing the migration includes stopping write operations on the source database, taking and uploading the last transaction log backup, stopping the incremental load, and promoting the migration job to switch to the new Cloud SQL for SQL Server instance.\u003c/p\u003e\n"]]],[],null,["# Migrate your SQL Server databases to Cloud SQL for SQL Server\n\nThis page describes how to migrate your SQL Server databases to\nCloud SQL for SQL Server instance with Database Migration Service.\n\nThe migration process involves the following tasks:\n\n1. Exporting full database backup, and transaction\n log files from the source SQL Server instance.\n\n You can also use the optional differential database backup in your migration\n process.\n2. Uploading your backup files to a Cloud Storage bucket.\n\n3. Creating the destination Cloud SQL for SQL Server instance.\n\n4. Creating and running the migration job in Database Migration Service.\n\n5. Monitoring the migration job progress with Database Migration Service observability\n features.\n\n6. Promoting the migration job after the data is fully migrated.\n\nCosts\n-----\n\nFor homogenous migrations to Cloud SQL, Database Migration Service is offered\nat no additional charge. However, Cloud SQL and Cloud Storage pricing\napplies for network charges as well as Cloud SQL and Cloud Storage\nentities created for migration purposes.\n\nIn this document, you use the following billable components of\nGoogle Cloud:\n\n- Cloud Storage\n- Cloud SQL\n\nTo generate a cost estimate based on your projected usage, use the\n[pricing calculator](/products/calculator).\n\nBefore you begin\n----------------\n\n1. Verify if this migration path can fully support your scenario. See [SQL Server\n Known limitations](/database-migration/docs/sqlserver/known-limitations).\n2. Consider in which region you want to create the destination database. Database Migration Service is a fully-regional product, meaning all entities related to your migration (source and destination connection profiles, migration jobs, destination databases, storage buckets) must be saved in a single region.\n3. In the Google Cloud console, on the project selector page, select or [create a Google Cloud project](/resource-manager/docs/creating-managing-projects).\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n4. Enable the Database Migration Service, Compute Engine, Cloud Storage, and Cloud SQL Admin APIs. [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=compute.googleapis.com,datamigration.googleapis.com,sqladmin.googleapis.com,storage.googleapis.com)\n\n### Required roles\n\nTo get the permissions that you need to perform homogeneous SQL Server\nmigrations with Database Migration Service, ask your administrator to grant the\nrequired IAM roles on your project for the following\n[accounts involved in the migration process](/database-migration/docs/sqlserver/access-control)\n\n- User account that performs the migration:\n - [Database Migration Admin](/iam/docs/roles-permissions/datamigration#datamigration.admin) (`roles/datamigration.admin`)\n - [Storage Admin](/iam/docs/roles-permissions/storage#storage.admin) (`roles/storage.admin`)\n - [Cloud SQL Editor](/iam/docs/roles-permissions/cloudsql#cloudsql.editor) (`roles/cloudsql.editor`)\n- Database Migration Service service account:\n - [Database Migration Admin](/iam/docs/roles-permissions/datamigration#datamigration.admin) (`roles/datamigration.admin`)\n - [Storage Admin](/iam/docs/roles-permissions/storage#storage.admin) (`roles/storage.admin`)\n - [Cloud SQL Editor](/iam/docs/roles-permissions/cloudsql#cloudsql.editor) (`roles/cloudsql.editor`)\n - [Cloud SQL Studio User](/iam/docs/roles-permissions/cloudsql#cloudsql.studioUser) (`roles/cloudsql.studioUser`)\n\nFor more information about granting roles, see\n[Manage access](/iam/docs/granting-changing-revoking-access).\n\nThese predefined roles contain the permissions required to perform homogeneous\nSQL Server migrations with Database Migration Service. To see the exact permissions\nthat are required, expand the **Required permissions** section: \n\n#### Required permissions\n\nThe following permissions are required to perform homogeneous SQL Server\nmigrations with Database Migration Service:\n\n- User account that performs the migration:\n - `datamigration.* `\n - `resourcemanager.projects.get`\n - `resourcemanager.projects.list`\n - `cloudsql.operations.get`\n - `cloudsql.instances.create`\n - `cloudsql.instances.get`\n - `cloudsql.instances.list`\n - `cloudsql.instances.import`\n - `cloudsql.databases.get`\n - `cloudsql.databases.list`\n - `cloudsql.databases.delete`\n - `compute.machineTypes.list`\n - `compute.machineTypes.get`\n - `compute.projects.get`\n - `storage.buckets.create`\n - `storage.buckets.list`\n- Database Migration Service service account:\n - `datamigration.* `\n - `resourcemanager.projects.get`\n - `resourcemanager.projects.list`\n - `cloudsql.instances.create`\n - `cloudsql.instances.get`\n - `cloudsql.instances.list`\n - `cloudsql.instances.executeSql`\n - `storage.objects.create`\n - `storage.objects.list`\n\nYou might also be able to get these permissions with\n[custom roles](/iam/docs/creating-custom-roles) or other\n[predefined roles](/iam/docs/roles-permissions).\n\nPrepare your source data\n------------------------\n\nTo prepare your source data for migration, follow these steps:\n\n1. [Consider your backup strategy for the migration process](/database-migration/docs/sqlserver/supported-backup-files).\n Database Migration Service supports using a differential backup and the transaction log\n files for migrating data that appears in your database after you take the full\n backup.\n\n2. [Perform a full backup of your source SQL Server database](/database-migration/docs/sqlserver/export-backup-files).\n Make sure you use the correct naming pattern.\n\n3. [Prepare a Cloud Storage bucket and upload your backup files to it](/database-migration/docs/sqlserver/storage-buckets).\n Make sure you set up the necessary directory structure for each backup file type\n you want to use.\n\n4. [Create a source connection profile](/database-migration/docs/sqlserver/create-source-connection-profile) for the Cloud Storage bucket.\n\nPrepare your Cloud SQL for SQL Server destination instance\n----------------------------------------------------------\n\nTo configure your destination Cloud SQL instance, perform the following steps:\n\n1. [Create and configure your Cloud SQL for SQL Server destination instance](/database-migration/docs/sqlserver/create-cloud-sql-destination-instance).\n Make sure you use enough compute and memory resources to cover your migration needs,\n and assign the Storage Admin (`roles/storage.admin`) role to the instance's\n service account.\n\n2. [Create a destination\n connection profile](/database-migration/docs/sqlserver/create-destination-connection-profile) for your Cloud SQL instance.\n\nCreate and run the migration job\n--------------------------------\n\nTo configure and run your migration, perform the following steps:\n\n1. [Create and run the migration job](/database-migration/docs/sqlserver/create-migration-job).\n\n When you start the migration job, your destination Cloud SQL for SQL Server\n databases are put into recovery mode where they are fully managed by\n Database Migration Service. You can promote your destination instance\n when your data is fully migrated. After your destination instance is promoted,\n all the databases in that instance become fully operational. You also gain\n full write access to those databases.\n | **Note:** To you use a differential backup file in the migration process, you need to use a specific configuration when you create the migration job. You can upload the differential backup file at a later time- after you create the migration job, but before you start uploading transaction log files.\n\n You can monitor the migration progress, as well as your destination instance\n health with Database Migration Service observability\n features. See\n [Migration job metrics](/database-migration/docs/sqlserver/migration-job-metrics).\n2. Keep uploading new transaction log backup files to the Cloud Storage bucket.\n\n To cover data that appears in your source database after you perform\n the full backup export,\n [export transaction log backup files](/database-migration/docs/sqlserver/export-backup-files) and upload them to\n the storage bucket. Database Migration Service automatically detects new files,\n reads their contents, and pushes the data to your destination instance.\n See\n [Automate transaction log exports](/database-migration/docs/sqlserver/automate-backup-exports).\n\nFinalize the migration\n----------------------\n\nWhen you decide to switch your application to the new Cloud SQL for SQL Server\ninstance, finalize the migration by following these steps:\n\n1. Stop all write operations on your source databases. You can switch them to read-only mode to retain operational functionality.\n2. Take the last transaction log backup, upload the file to your storage bucket, and stop the incremental load phase in Database Migration Service. You can achieve this result by performing one of the following actions:\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. [Promote the migration job](/database-migration/docs/sqlserver/finalize-migration).\n4. (Optional) [Verify migration data](/database-migration/docs/sqlserver/verify-migration) for completeness."]]