blog image

AEM as Cloud Services Maintenance

AEM, Technology

  • icons12 September, 2022
  • iconsUday Patel

Adobe Experience Manager (AEM) is a complete content management system that can create websites, applications, and forms in the modern world. Additionally, it makes it simple to manage your marketing materials and content.

Application maintenance for AEM has two sides. One is ongoing, routine maintenance, which is the responsibility of the AEM Administrator. Following best practices in application development is the second practice. Here we list the maintenance tasks for AEM as Cloud Services.

Maintenance tasks for AEM as Cloud Services

Maintenance Tasks are scheduled activities that optimize the repository. In previous versions of Adobe Experience Manager, we could configure the maintenance tasks using the Maintenance Card under Tools -> Operations -> Maintenance.

This Maintenance Card allows the customers to configure the following tasks as part of the Daily/Weekly Maintenance.

  1. Datastore Garbage Collection
    The unreferenced datastore records are marked as “garbage” and it is beneficial is get rid of them to preserve space and filesystem maintenance performance.

  2. Version Purge
    To keep the author instance performant, the older versions of the repository node under /content node are purged.

  3. Audit Log Purge
    To keep the author instance performant, the older audit logs under / the content node of the repository are purged.

  4. Lucene Binaries Cleanup
    This task helps to purge Lucene binaries and reduce the running data store size requirement. This will help us to execute the Datastore Garbage collection faster.

  5. Ad-hoc Task Purge
    Purges the ad-hoc tasks created and the configuration allows to set if to purge the completed task or pending tasks.

  6. Workflow Purge
    Minimizing the number of workflow instances increases the performance of the workflow engine, so you can regularly purge completed or running workflow instances from the repository.

  7. Project Purge
    Helps to add configurations needed to purge the projects during maintenance.

For AEM as Cloud Services, the Maintenance card is no longer available to configure. Now that the card is unavailable, the above configurations cannot be applied using a GUI, but this needs to go from the Code.

Note: The code to the Adobe Cloud instance can be deployed only using Cloud Manager.

The good news is – Customers need not configure all the maintenance tasks as part of the code. Ad-hoc Task Purge, Workflow Purge, and Project Purge are the only tasks configured by the customer, and the rest Adobe handles all configurations.

Implementation:

To configure the Daily/Weekly Maintenance task, Override the out-of-the-box Maintenance window configuration node under /libs by creating properties under the folder /apps/settings/granite/operations/maintenance/granite_weekly or granite_daily.

The folder structure will look similar to the below:

ui.apps
└jcr_root
   └ apps
       ├ settings
└─ granite
    └─ operations
                └─ maintenance
                              ├── granite_daily
                              └── granite_weekly

Code Sample (Daily)

The below configuration for the granite_daily will schedule the Daily Maintenance between 2:00 AM – 5:00 AM (uses 24 hours clock of the server)

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
          jcr:primaryType="sling:OrderedFolder"
          sling:configCollectionInherit="true"
          sling:configPropertyInherit="true"
          windowEndTime="05:00"
          windowSchedule="daily"
          windowStartTime="02:00">
</jcr:root>

Code Sample (Weekly)

The below configuration for the granite_weekly will schedule the Weekly Maintenance every Saturday between 6:00 – 17:00 (uses 24 hours clock of the server)

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
          jcr:primaryType="sling:OrderedFolder"
          sling:configCollectionInherit="true"
          sling:configPropertyInherit="true"
          windowEndTime="17:00"
          windowSchedule="weekly"
          windowScheduleWeekdays="[7,7]"
          windowStartTime="06:00">
</jcr:root>

Now that the Daily and the Weekly Maintenance are configured for a specific time, we will configure the tasks to be executed during the maintenance window

Ad-hoc Task Purge

Enable the maintenance task by adding a node under the granite_daily or granite_weekly (name it granite_TaskPurgeTask) with the appropriate properties depending on the requirement.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/operations/components/maintenance/task"
    granite.maintenance.name="TaskPurge"
    granite.task.hint="HINT: Configure when to purge and if to purge complete/active tasks"
/>

Workflow Purge

Enable the maintenance task by adding another node under the node above (name it granite_WorkflowPurgeTask) with the appropriate properties.

Example:

Workflow Purge
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/operations/components/maintenance/task"
    granite.maintenance.name="WorkflowPurgeTask"
    granite.task.hint="HINT: Please add workflow models to be deleted to the workflow-purge configuration, which is available under Adobe Granite Workflow Purge Configuration under Web Console Configuration-Manager."/>

Project Purge

Enable the maintenance task by adding another node under the node above (name it granite_ProjectPurgeTask) with the appropriate properties. Configure the OSGI properties.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/operations/components/maintenance/task"
    granite.maintenance.name="ProjectPurgeTask"
    granite.task.hint="HINT: Please add peojects to be deleted to the projects-purge configuration, which is available under Adobe Projects Purge Configuration under Web Console Configuration-Manager."/>

Thus, the Maintenance tasks on AEM as Cloud Service are configured.

If you’d want to learn more about AEM as Cloud Services, please reach out to us.

Leave A Comment

Your email address will not be published. Required fields are marked *