web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

LCS Exported bacpac file contains corrupt data

(1) ShareShare
ReportReport
Posted on by 1,461

I am using docs.microsoft.com/.../dbmovement-scenario-exportuat to export the UAT environment DB and then import it into my cloud-hosted development environment that is on our own subscription.Which means I have administration rights on my Dev environment.

I never had a problem doing this. But the last two times I get an error importing the bacpac-file. The first time I thought maybe something went wrong because downloading it from LCS took ages.

I decided to try it again today and it downloaded the 7GB bacpac file from the Asset library (download method: go to LCS >  Asset Library > Database backup and click on the backup file name then choose Save as and saved it to the created sub-directory Exportedbacpac onTemporary Storage drive ) within 30 minutes which is the normal length it takes to download.

Then I follow the steps in the link mentioned above. I even opened command prompt with run as administrator. However it returns with the error that the file contains corrupted data.

***

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>
***
Any reason why my cloud hosted development environment doesn't like a bacpac-file created by LCS anymore?
The test environment which is a tier-2 in on V10.0.5 PU29 and my development environment is on V10.0.6 PU30. 
Any help and suggestions to get this bacpac file into my development DB is much appreciated.
I have the same question (0)
  • Suggested answer
    Rahul Mohta Profile Picture
    21,042 on at

    are both enviornments on same PU?

    Try to restore to another sandbox tier 2 and then try to export from there manually

  • Verified answer
    Fangyuan Hou Profile Picture
    on at

    Hi Retha,

    Can you please visit docs.microsoft.com/.../sqlpackage-download  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.

  • Retha Profile Picture
    1,461 on at

    Hi Fangyuan,

    That worked like a charm. Thank you very much

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    The latest version of .NET Core SqlPackage is causing an issue. It throws an error while importing - 

    *** Error importing database:Could not import package.
    Warning SQL0: The source contains users that rely on an external authentication provider that is not supported by the target. These users will be treated as users without logins.
    Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 102, Level 16, State 30, Line 1 Incorrect syntax near 'type'.
    Error SQL72045: Script execution error. The executed script:
    CREATE USER [d365-ops-dbms-prod]
    WITH SID = 0******162, TYPE = E;

    To resolve this this issue, please use a previous version - https://go.microsoft.com/fwlink/?linkid=2109019

    Also, please increase the timeout value to 3600 in this statement -  "SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200".

  • Dennis M Profile Picture
    15 on at

    Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans