Install Alfresco Module Package - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

An Alfresco Module Package (AMP) is a bundle of code, content model, content, and the directory structure that is used to distribute additional functionality for Content Services. Use the Module Management Tool (MMT) to install and manage AMP files. You can install an AMP in an Alfresco WAR using the MMT, or by using the apply_amps tool.

The MMT is available as a JAR file from the distribution zip (alfresco-content-services-distribution-xx.x.x.zip, where xx.x.x is the latest version), in the zip’s /bin directory. Place the /bin directory and its contents in the same location where you extracted the Content Services distribution zip; for example <installLocation>/bin.

  1. Browse to the /bin directory, for example:
    1. (Windows) C:\Alfresco\bin
    2. (Linux) /opt/alfresco/bin
  2. Run the apply_amps application to apply all AMP files that are in the amps and amps_share directories:
    1. For Windows, navigate to the bin directory and double click apply_amps.
    2. For Linux, enter the command:
        bin/apply_amps.sh
      
  3. Alternatively, to install individual AMP files, use the MMT:
     java -jar alfresco-mmt.jar install <AMPFileLocation> <WARFileLocation> [options]
    

    where:

    Option Description
    AMPFileLocation The location of the AMP file that you want to install.
    WARFileLocation The location of the WAR file for your installation.
    -verbose Install command option. Enables detailed output containing what is being updated and to where it is being copied.
    -directory Install command option. Indicates that the AMP file location specified is a directory. All AMP files found in the directory and its sub directories are installed.
    -force Install command option. Forces installation of AMP regardless of currently installed module version.
    -preview Install command option. Previews installation of AMP without modifying WAR file. It reports the modifications that will occur on the WAR without making any physical changes, for example, the changes that will update existing files. It is good practice to use this option before installing the AMP.
    -nobackup Indicates that the WAR will not be backed up before the AMP is installed.

    This command installs the files found in the AMP into the Alfresco WAR. If the module represented by the AMP is already installed and the installing AMP is of a higher release version, then the files for the older version are removed from the WAR and replaced with the newer files.

    The following commands show examples of how to install the example-amp.amp, and assumes that the AMP file is in the same directory as the WAR file:

     java -jar alfresco-mmt.jar install example-amp.amp alfresco.war -preview
    

    Review the installation preview to check how existing files in the WAR file will be updated, once you run the command without -preview.

    The following example installs the AMP file:

     java -jar alfresco-mmt.jar install example-amp.amp alfresco.war -verbose
    

    The modified Alfresco WAR can then be redeployed back into your application server.

    On restarting the application server, the console will show that the custom class was initialized during startup.

  4. Verify that the AMP is installed using the MMT list command. For example:
     java -jar alfresco-mmt.jar list <WARFileLocation>
    

    This command provides a detailed listing of all the modules currently installed in the WAR file specified.

When the repository is next started, the installed module configuration will be detected, and the repository will be bootstrapped to include the new module functionality and data.

We don’t recommended that you overwrite an existing file in an AMP, however it’s sometimes necessary. The MMT makes a backup copy of the updated file and stores it in the WAR. When a module is updated, and the old files are removed, this backup is restored prior to the installation of the new files. Problems can occur if multiple installed modules modify the same existing file. In these cases, a manual restore might be necessary, if recovery to an existing state is required.

Some application servers (notably Tomcat) don’t always fully clean up their temporary working files, and this can interfere with successful installation of an AMP file. To remedy this situation, it’s recommended that you delete (or move) the Tomcat work and temp directories while Tomcat is shut down.