Uninstall a deployable package from sandbox(UAT) environment or production- Dynamics 365 for Finance and Operations

Scenario: Sometime we need to uninstall a deployable package from the UAT or Production environment.

 

Solution:

Below are the steps that need to be performed to uninstall a package.

 

  • Create a deployable package using visual studio or Build server
  • Do not extract the deployable package that is in ZIP folder (If you extract the zip folder you will face issue invalid HotfixInstallationInfo.xml file)
  • Just open the deployable package zip folder
  • Go to Deployable package zip folder -> AOS service -> Scripts folder
  • create a text file name ‘ModuleToRemove’
  • Write the module name to be removed in the the ModuleToRemove file

Screen Shot 2019-11-23 at 9.10.48 PM

 

  •  If you have multiple models to remove then write mode name per line as below
    • Model1
    • Model2
    • Model3
  • Note: In multiple models removing write the models name in sequence as per dependency sequence
  • Go back to main zip folder and find the file HotfixInstallationInfo.xml ,copy the file to some other location and edit the file like below

<MetadataModuleList>
</MetadataModuleList>

 

<AllComponentList>
<ArrayOfString>
</ArrayOfString>
</AllComponentList>

  • Edit the file should be same as above.
  • Copy and replace the HotfixInstallationInfo.xml file in the deployable folder
  • upload the file in the asset library and apply the package to the UAT environment first if applied successfully then apply to the production environment.

 

Please leave comments if you are facing any issue.

 

 

 

How delete a specific model/package? Uninstall deployable package. Microsoft Dynamics 365 for Finance and Operations

Sometimes we need to delete the model and deployable package from the dev environments.

 

Model Deletion:

use Modelutil.exe to delete the model file from the packages local directory.

 

Package installation or deletion:

 

  1. Stop IIS (kill the IIS worker process from the task manager)
  2. Stop batch job DynamicsAXBatch job
  3. Delete the package folder located on C:\ or K:\AosService\PackagesLocalDirectory (make sure folder completely deleted)
  4. Open VS Dynamics -> Model Management -> Refresh models

 

 

 

Models Export and Import: Dynamics 365 for Finace and Operations

Scenario:

Export model from one dev environment to another dev enviornment

Steps to perform:

  1. Export model from enviornment using command prompt
  2. Import Model in another enviornment using command prompt
  3. Resolve conflicts
  4. Complete build of models and Synchonization of Database

 

Export Model:

Export the model using utilily name ModelUtil.exe located in the below path

K:\AosService\PackagesLocalDirectory\Bin

K:\ Drive can be varrried for local VM C:\ or J:\ 

Command:

ModelUtil.exe -export -metadatastorepath= [path of the metadata 
store] -modelname=[name of the model to export] -outputpath=[path 
of folder where model file should be saved]

 

Example:

ModelUtil.exe -export -metadatastorepath= K:\AosService\PackagesLocalDirectory -modelname=D365FnOModel -outputpath=C:\Users\Userf3d496631\Desktop\US\devmodelsbackup

Screen Shot 2019-09-08 at 4.47.49 PM

 

Import model:

To install or import a model file use below code

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:\Users\Userf3d46296631\Desktop\US\devmodelsbackup\D365FnOModel

Screen Shot 2019-09-08 at 4.59.11 PM.png

 

Delete a Model:

If model already exists in the destination environment. Delete the model using modelutility.exe

ModelUtil.exe -delete -metadatastorepath=[path of the metadata store]
 -modelname=[name of the model to delete]

Example:

ModelUtil.exe -Delete -metadatastorepath= K:\AosService\PackagesLocalDirectory -modelName=D365FnOModel

Screen Shot 2019-09-08 at 5.02.35 PM.png

 

Resolve the conflicts after importing:

 

Screen Shot 2019-09-08 at 5.04.05 PM.png

 

Build and sycnhronize:

after resolving all the conlicts build the model(all models would be better but it will take long time) and synchronize the database