Search code examples
sql-serverazuresqlpackagebacpac

Prevent SqlPackage from writing to primary partition during Export


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:)


Solution

  • 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.