As per the development guidelines provided by Alfresco for recent versions, the best way to deploy customizations is through AMP (Alfresco Module Package) form.
Advantages of using AMP
- Easy to deploy
- Easy to maintain the customization as everything bundled in to one package.
- Easy to undeploy to remove all customization
In this article, I am going to discuss how to undeploy your AMP file from Alfresco to remove any and any and all customizations.
Option 1:(Using backup WAR)
After applying an AMP file for the very first time, Alfresco will create a backup of alfresco.war and share.war in your web apps. You can revert back to these files to remove any customizations you may have made. To do this:
- Stop Alfresco server.
- Delete existing alfresco.war, share.war
- Delete explored folder alfresco and share.
- Rename old back up of war files to alfresco.war and share.war.
- Start Alfresco server.
You can refer the image where all files which are rounded with red should be deleted and files which are rounded with green has to renamed.
Option 2: (Using Module Management Tool)
Under <ALF_HOME>/bin folder of your Alfresco installation you could see that there is one batch file and one executable jar file(alfresco-mmt.jar) is available.That alfresco-mmt.jar contatins module management utility of alfresco.
It helps to install and uninstall amp files from alfresco.
Command to uninstall amp file is as follow.
java -jar bin/alfresco-mmt.jar uninstall <ModuleId> <WARFileLocation>
- ModuleID–> It represent the name of your amp which you want to uninstall from alfresco
- WarFileLocation–> Specify the location of war files which are placed under webapp folder. This is require to decide module has to be uninstall from alfresco or share.
This is easier method compare to first one but manual operations comes in handy when things go wrong. Once you execute above command you should be able to see changes in size of war file which is available under your webapp.