Parag Chapre

Import bacpac error: File contains damaged data

File contains corrupted data - Import bacpac
Spread the love

This week, I attempted to import a bacpac file on my development machine using SQLPackage for Windows, but I encountered an error while reading the bacpac file. The error message stated: “File contains damaged data.

Resolution:
  • Download SQLPackage .NET Core software in your Development Machine.
  • To extract the file by right-clicking on the file in Windows Explorer, and selecting ‘Extract All…’, and select the target directory.
  • Open a new Terminal window and cd to the location where SqlPackage was extracted:

Command to import bacpac

SqlPackage.exe /a:import /sf:”Database bacppac file” /tsn:localhost /tdn:AxDB /p:CommandTimeout=1200 /TargetTrustServerCertificate:True

Example:

SqlPackage.exe /a:import /sf:”C:\Temp\Testbackup.bacpac” /tsn:localhost /tdn:AxDB_New /p:CommandTimeout=1200 /TargetTrustServerCertificate:True

Leave a Reply

Your email address will not be published. Required fields are marked *