This page describes data migration options in Cloud SQL.

## Database Migration Service

You can migrate SQL Server databases to Cloud SQL for SQL Server
instances with Database Migration Service by using a backup and restore flow.
You first upload the full database backup and transaction
log files to a Cloud Storage bucket. Database Migration Service then actively
monitors your bucket and continuously replicates your data to the destination
Cloud SQL for SQL Server instance. For more information, see
[SQL Server migrations overview](https://docs.cloud.google.com/database-migration/docs/sqlserver/scenario-overview.md.txt) in the
Database Migration Service documentation.

### Distributed Availability Group (DAG) migrations

Database Migration Service supports migrating self-managed SQL Server databases
to Cloud SQL for SQL Server by using SQL Server
[Distributed Availability Groups (DAG)](https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/distributed-availability-groups?view=sql-server-ver17).

Instead of exporting and uploading backup and transaction log files to a
Cloud Storage bucket, Database Migration Service configures a
Distributed Availability Group between your source Availability Group and a
managed secondary Availability Group on your destination Cloud SQL for SQL Server
instance. This configuration streams both the initial full load and ongoing
database changes directly over a private network connection.

For more information, see the following resources:

- [About Distributed Availability Group migrations](https://docs.cloud.google.com/database-migration/docs/sqlserver/dag-migration-overview.md.txt)
- [Configure database flags](https://docs.cloud.google.com/sql/docs/sqlserver/flags.md.txt#sqlserver-enable-dag-support)
- [Stored procedures](https://docs.cloud.google.com/sql/docs/sqlserver/stored-procedures.md.txt#dag-supported-stored-procedures)

## Replicate from an external server

Another option for migrating data from an external server
into Cloud SQL is to use replication.
Cloud SQL supports various replication modes
to migrate data into your instance.

For more information, see
[About replicating from an external server](https://docs.cloud.google.com/sql/docs/sqlserver/replication.md.txt).

## Limitations

- If your instance has customized backup settings (for example, a [custom backup location](https://docs.cloud.google.com/sql/docs/sqlserver/backup-recovery/backing-up#locationbackups)), then after you promote or demote the instance, we recommend that you customize your backup settings again. During the promotion and demotion processes, Cloud SQL resets your backup settings to their default values.