Model Import and Export in D365 Finance and Operations using PowerShell
Shayan Arshi
Microsoft Dynamics AX 365 F&O | AX 2012 | PowerApps | Azure DevOps| SQL Server | Blogger | Associate Architect at Qatar Free Zone | XSystems LTD
Hello Devs!
Whenever we have to move our code of?specific model?from one environment to another, one of the method we use is we export model and import it into another using model file via PowerShell. Below are the list of steps you need to perform for model export and import.
???????????????????????????????????????????????Export Model File:
1) Open PowerShell in admin mode.
2) Change directory and navigate to bin folder using below command.
?cd C:\AOSService\PackagesLocalDirectory\bin
3) Export the file using below command
.\ModelUtil.exe -export -metadatastorepath=[path of the metadata store] -modelname=[name of the model to export] -outputpath=[path of the folder where the model file should be saved]
Example :
.\ModelUtil.exe -export -metadatastorepath=K:\AosService\PackagesLocalDirectory -modelname=AXY365 -outputpath=c:\Projects\Exported
In my case it look like this,
领英推荐
Import Model File
Prerequisite:
The model should be deleted before importing the file, if it already exists in the folder.??
1) Open PowerShell in admin mode.
2) Change directory and navigate to bin folder using below command.
?cd C:\AOSService\PackagesLocalDirectory\bin
3)?Install /Import the file using below command
ModelUtil.exe -import -metadatastorepath=[path of the metadata store where model should be imported] -file=[full path of the file to import]
Example :
.\ModelUtil.exe -import -metadatastorepath=K:\AosService\PackagesLocalDirectory -file=c:\Projects\Exported\AXZ365-Dev.axmodel
In my case it look like this,
This is how you can successfully export and import model in D365 F&O using PowerShell.
Hope you find the information helpful.??