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
Parag Chapre
Parag Chapre is a Microsoft MVP in the fields of Dynamics 365 Finance & Operations, Human Resources, and Power Platform, recognized for his outstanding contributions to the Microsoft Dynamics community.
With over 15 years of hands-on expertise in various Microsoft Dynamics 365 areas, Parag has designed and delivered complex, innovative solutions for customers across industries and geographies. He has also provided leadership and technical guidance to project teams, managed offshore and onshore resources, and worked closely with Microsoft Product teams. Parag is passionate about sharing his knowledge and insights through his personal website, blog posts, articles, and community events. He is a member of the Microsoft Biz Apps Community Advisory Board, a Dynamics 365 Human Resource Community star, a Dynamics 365 Community contributor, and a Dynamics 365 Community Spotlight honoree.




