Model Import and Export in D365 Finance and Operations using PowerShell

Model Import and Export in D365 Finance and Operations using PowerShell

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


No alt text provided for this image

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,

No alt text provided for this image

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

No alt text provided for this image

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,

No alt text provided for this image

This is how you can successfully export and import model in D365 F&O using PowerShell.


Hope you find the information helpful.??

要查看或添加评论,请登录

Shayan Arshi的更多文章

社区洞察

其他会员也浏览了