Dave Farinelliz—
title: “Copy Azure SQL Database to GCP Cloud SQL”
date: 2023-10-11T18:43:08Z
draft: false
Pre-reqs
- Azure Account with both:
- Azure SQL and Storage Account
- Azure SQL needs to allow Azure to access resource.
- GCP Account with:
- Cloud SQL (needs contained database authentication flag)
- SSMS
- SQL Server Developer Edition (match version used in Cloud SQL)
- Needs
sp_configure
for contained database authentication.
Process
- (Linux) In Azure, scale up the DB to max DTUs to speed export process.
- Export .bacpac to Azure Storage Account.
- After export completion, scale DB back down to previous DTUs.
- (Windows) Download .bacpac using Azure Storage Explorer.
- Connect to local SQL via SSMS.
- Import Data-tier Application
- Create .bak (Database -> Tasks -> Backup)
- Upload .bak to storage account with either Azure Storage Explorer or AzCopy. (Program Files/Microsoft SQL Server/**)
- Delete .bacpac with Azure Storage Explorer
- (Linux) Create SAS via Portal
- Create and run STS job to copy file.
- Import .bak from GCS bucket to GCP Cloud SQL.
Troubleshooting