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

bacpac Import failed from LCS into local Dev Box

(5) ShareShare
ReportReport
Posted on by 144
Hi, 

We have made multiple attempts to import a new .bacpac file from LCS into our local development environment; however, each attempt has failed with consistent results. The import process fails due to corruption in the .bacpac file.
Although, as mentioned above we created each time new export in LCS.

Additionally, we attempted to perform the import using PowerShell, but that approach was unsuccessful as well.

Note: Both the source and target environments are on the same Platform Update (PU).

We would appreciate any guidance or a recommended solution to resolve this issue.

Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    Do you have the latests versions of SSMS and SqlPackage?
     
    Can you please elaborate your statement "that approach was unsuccessful as well"? Did you get the same error or was it unsuccessful for another reason?
  • D356FO_Dev Profile Picture
    144 on at
    Hi Martin, 

    Thanks for responding quickly.
    Yes SSMS and sql package are upto date.

    This is the error with powershell approach:
    [Invoke-Process] Error output was: \r\n *** Error importing database:Could not import package.
    Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 4630, Level 16, State 1, Line 1 The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server. Alternatively, use the server level 'ALTER ANY CONNECTION' permission.
    Error SQL72045: Script execution error.  The executed script:
    GRANT KILL DATABASE CONNECTION TO [ms_uno_dev_writer];
  • Suggested answer
    Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    The problem with 'KILL DATABASE CONNECTION' is well-known. You can use Repair-D365BacpacModelFile from d365.tools, for instance, to fix the file.
  • D356FO_Dev Profile Picture
    144 on at
    I use the following commands 
    C:\> Repair-D365BacpacModelFile -Path C:\Temp\repair\testbackup\model.xml -KeepFiles -Force

    Removed the original model.xml and renamed model-edited.xml back to model.xml.

    After that, I compressed the folder contents into a ZIP archive and changed the file extension back to .bacpac.

    However, during the import process, I encountered the following error:

    origin.xml not found

    I’ve verified that the origin.xml file is indeed present in the root of the folder before compression. It appears the import process is still failing to detect it.

    Looking forward..

    @Martin Dráb


     
  • Verified answer
    Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    I haven't dealt with this problem by myself, but there are resources to consult. Fix "The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server" while importing a D365FO .bacpac mentions that a new checksum would have to be calculated and that it can be address by using /mfp parameter, rather then trying to update the package manually. Give it a try.
  • DN-27070130-0 Profile Picture
    61 on at
    Hi,

    Anyone have success for restore .bacpac file to Local Dev?
    I already try using /mfp to using custom model.xml but the error still same, like the sqlpackage still using model.xml from .bacpac

    How to make a new calculated checksum after I modified model.xml??
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    You seem to suggest that the .bacpac doesn't contain the modified file, which means that you skipped the step "Then copy and replace the modified model.xml into the zipped package and change the package file extension from .zip to .bacpac".

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