0

I have a .bacpac file exported from an Azure SQL Server database and I want to import that into GCP Cloud SQL.

As I understand, cloud SQL has the gcloud sql import bak command that allows you to do this but this only supports .bak files as opposed to .bacpac.

Is my understanding correct?

If so, are there are any alternatives to achieve this in GCP?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Vikram
  • 170
  • 1
  • 12

2 Answers2

0

According to the documentation, Cloud SQL supports only full backup file, hence bacpac might not be supported. As a workaround I suggest you to install SQL Server on a GCE instance, perform the import there, then finally import again from GCE instance to Cloud SQL.

drauedo
  • 641
  • 4
  • 17
0

By using Azure Automation account and google storage transfer jobs you are able to get an export of your Azure Sql Server database into .bacpac and then import it to google cloud sql server.

You can find the scripts along with details steps on how to import the bacpac files into google cloud here, but a the summary is:

  1. Create a copy of your azure sql database (don’t export directly due to consistency).
  2. Export the copied DB to .bacpac into an azure storage bucket.
  3. Import that .bacpac file into google storage using Google Transfer job
  4. Create a VM in google compute engine and instal Microsoft SQLpackage (it allows to import .bacpac files into sql server)
  5. Spin a SQL Server 2019 in google cloud
  6. Run a script in the VM that imports the .bacpac into the SQL server
out_sid3r
  • 1,018
  • 2
  • 20
  • 42