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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Error while importing the bacpac file to dev machine

(1) ShareShare
ReportReport
Posted on by 183
Hi ,
I exported the bacpac file from LCS and tried this command while importing - SqlPackage.exe /a:import /sf:C:\Users\Admin195bb577ec\Downloads\UAT.bacpac /tsn:localhost /tdn:AXDBUAT /p:CommandTimeout=1200 /TargetEncryptConnection:False 
 
 
 
Please suggest how to move further. Tried editing the model file but afterward how to procced, i am confused.
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,443 Super User 2025 Season 2 on at
    Hi,
     
    Try this :
     
    1. Open the .bacpac file using WinRar
    2. Copy the model.xml to a local folder “C:\Temp\model.xml 
    3. Edit the “C:\Temp\model.xml” with the desired password. For example: 

    find  <Property Name="AutoDrop" Value="True" />  and Delete

    4.  Run the import using sqlpackage.exe, but use the /ModelFilePath:C:\Temp\model.xml parameter to override the model.xml in the .bacpac file

     

    Best regards,

    Mohamed Amine MAHMOUDI

  • spidey1010 Profile Picture
    183 on at
    HI,
    I saw that reply on other thread. As i told u, i have edited the model file but cant proceed further like where should i use model file path in my command ?
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,443 Super User 2025 Season 2 on at
    Hi,
     
    you can use this :
     
    SqlPackage.exe /a:import /sf:C:\Users\Admin195bb577ec\Downloads\UAT.bacpac /tsn:localhost /tdn:AXDBUAT 
    /ModelFilePath:C:\Users\Admin195bb577ec\Downloads\model.xml 
     
     
    Best regards,
    Mohamed Amine Mahmoudi
  • spidey1010 Profile Picture
    183 on at
    HI Amine,
    Got the same error,
  • Suggested answer
    Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    This is caused by a property added in a newer version of SQL Server than what you're using locally. You can remove it from the bacpac file with Repair-D365BacpacModelFile from d365fo.tools.
  • spidey1010 Profile Picture
    183 on at
    HI Martin,
    Tried executing this 
    Repair-D365BacpacModelFile -Path C:\Temp\Base.xml -KeepFiles -Force 
     
    But it says that it cannot recognise the Repair-D365BacpacModelFile as a command.
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    It means that you didn't install the Powershell module d365fo.tools correctly (or at all).
  • Verified answer
    spidey1010 Profile Picture
    183 on at
    This helped me resolving the issue - 
    1. Go to sql package folder.
    2. Open the power shell via admin.
    3. Run this command -  
    PS C:\Users\Admin195bb577ec\Downloads\sqlpackage-win-x64-en-162.4.92.3> .\SqlPackage.exe /a:import /sf:"I:\UAT.bacpac" /tsn:localhost /tu:axdbadmin /tp: ‘AX SQL password’ /tdn:AXDBUAT /p:CommandTimeout=1200 /p:DatabaseEdition=Premium /p:DatabaseServiceObjective=P1 /ttsc:true

    Replace AX SQL password with your sql password taken form LCS.
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans