Tag Archives: Model
Import, Export and Uninstall the model from Microsoft Dynamics AX 2012
Introduction: In this blog, we will see how we can import, export and uninstall the model from Microsoft Dynamics AX 2012 Details: Prerequisite for import, export and uninstall the model from the environment, run the command prompt as in administrator mode. Form Importing the model script: Install-AXModel -File “Path_Of_the_Model_File” -server ServerName -database DatabaseName_Model –Details Exmaple: Install-AXModel -File “D:\Model\VARModel.axmodel” -server CFSEnvVM -database DAX2012R3CFSEnv_Model –Details Form Exporting the model script: Export-AXModel -Model ‘Model’ -File ‘Path’ -server ‘ServerName\DBName’ -database ‘DatabaseName_Model’ Exmaple: Export-AXModel -Model ‘CUS Model’ -File ‘C:\ModelFile\CUSModel.axmodel’ -server ‘TESTSERVER\CFSDAXSQL2014’ -database ‘DAX2012R3Blank_model’ Form Uninstalling the model script: Uninstall-AXModel -Model ‘Model’ -server ‘ServerName’ -database ‘DatabseName_Model’ Exmaple: Uninstall-AXModel -Model ‘VAR Model’ -server ‘CFSEnvVM’ -database ‘DAX2012R3Test_model’ Thanks for reading !!!
Model import and export in D365 Finance and Operations using Powershell
When we want to move customization done on specific model from one environment to other development environment we need to export and import the model file. Steps for model import and export using PowerShell :- Open PowerShell in administrator mode. Change directory to the path of package bin folder. Export command:-.\ModelUtil.exe -export -metadatastorepath=C:\AOSService\PackagesLocalDirectory -modelname=”name of model” -outputpath=path to store model after exportFor example: If model name is TOUpgradeModel and I want to store the model file to path is C:\Temp\ModelFile The command will be as follows: .\ModelUtil.exe -export -metadatastorepath=K:\AosService\PackagesLocalDirectory -modelname=”TOUpgradeModel” -outputpath=C:\Temp\ModelFile Output file you can see on the specified path as Import Command :-.\ModelUtil.exe -import -metadatastorepath=C:\AOSService\PackagesLocalDirectory -file=the path from. axmodel to importFor example: .\ModelUtil.exe -import -metadatastorepath=C:\AOSService\PackagesLocalDirectory -file=C:\Temp\ModelFile\TOUpgradeModel-Cloudfront.axmodel ( Note : If model already exist in your environment, trying to import the same model you will receive the error message of “Model already exist”. So, delete the existing model by command .\ModelUtil.exe -delete -metadatastorepath=C:\AOSService\PackagesLocalDirectory -modelname=” TOUpgradeModel ” try to import the model)