0

To move a 144GB SQL Server database to Azure SQL I want to export it to the .bacpac format.

To do so I use SQL Package of SQL Version 130:

C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin>SqlPackage.exe /Action:Export /ssn:MY_MSSQL_INSTANCE /sdn:MY_DATABASE /tf:d:\export.bacpac /p:Storage=file

However, this fails because my primary partition (C:, with 39GB free) runs out of disk space during the operation. As you can see in the command I try to export to D:. It seems the export script does something temporary on C:.

How can I prevent that? (I already checked the default SQL Server Temp path, it's also on D:)

Gabriël
  • 1,323
  • 2
  • 22
  • 34

4 Answers4

1

SqlPackage.exe uses three locations on disk: the selected output path, the temp folder, and the isolated storage folder.

By default the temp folder and the isolated storage folder are on the primary drive. I believe you can change temp folder location by changing the environment variable and then (in the same command prompt) running SqlPackage.exe, like so:

set TMP=d:\temp
SqlPackage.exe /a:export ...

This may not be sufficient, though, because of the use of Isolated Storage.

Steven Green
  • 3,387
  • 14
  • 17
0

I've tried it again on a VM having 300GB and even 600GB of free disk space, it still fails to work. I will now go to try other methods: Microsoft Data Migration Assistant, or transfer schema first and then use SQL Server Import Export Wizard to move the data.

Gabriël
  • 1,323
  • 2
  • 22
  • 34
0

With version 18.7 there is a new parameter available for that /p:TempDirectoryForTableData=(STRING)

BioBier
  • 84
  • 1
  • 11
-1

Increase the C drive size and execute.