LCS Exported bacpac file contains corrupt data
Error:
C:\windows\system32>cd C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin
C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin>SqlPackage.exe /a:import /sf:D:\Exportedbacpac\tmctestbackup.bacpac /tsn:localhost /tdn:AxDBCopy4 /p:CommandTimeout=21600
Error:
C:\windows\system32>cd C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin
C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin>SqlPackage.exe /a:import /sf:D:\Exportedbacpac\tmctestbackup.bacpac /tsn:localhost /tdn:AxDBCopy4 /p:CommandTimeout=21600
Importing to database 'AxDBCopy4' on server 'localhost'.
*** Error importing database:Could not load package from 'D:\Exportedbacpac\tmctestbackup.bacpac'.
File contains corrupted data.
C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin>
***
Solution:
Go to https://docs.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-ver15
to download .NET CORE version of Sqlpackage.exe. This is a .zip file that can be extracted to C:\Temp\Sqlpackage-dotnetcore.
From there, instead of using the Sqlpackage.exe under C:\Program Files (x86), please can you use the Sqlpackage.exe in C:\Temp\Sqlpackage-dotnetcore.
Go to https://docs.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-ver15
to download .NET CORE version of Sqlpackage.exe. This is a .zip file that can be extracted to C:\Temp\Sqlpackage-dotnetcore.
From there, instead of using the Sqlpackage.exe under C:\Program Files (x86), please can you use the Sqlpackage.exe in C:\Temp\Sqlpackage-dotnetcore.
Happy DBing!
Thanks & Regards,
Mail ID: pandit.umesh@hotmail.com
Skype ID: pandit.umesh
It is a very informative and useful post thanks it is good material to read this post increases my knowledge. Azure Database Administrator Associate
ReplyDelete