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

Announcements

News and Announcements icon
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 203
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,803 Super User 2026 Season 1 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
    203 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,803 Super User 2026 Season 1 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
    203 on at
    HI Amine,
    Got the same error,
  • Suggested answer
    Martin Dráb Profile Picture
    239,805 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
    203 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
    239,805 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
    203 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 487 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 433

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans