Ensure Sufficient Disk Space

When executing the upgrade, in addition to the content and code upgrade activities, a repository migration will need to be performed. The migration will create a copy of the repository in the new Segment Tar format. As a result, you will need enough disk space to retain a second, potentially larger, version of your repository.

Fully Back Up AEM

AEM should be fully backed up before beginning the upgrade. Make sure to back up your repository, application installation, datastore, and Mongo instances if applicable. For more information on backing up and restoring an AEM instance, see Backup and Restore.

Back Up Changes to /etc

The upgrade process does a good job of maintaining and merging existing content and configurations from under the /apps and /libs paths in the repository. For changes made to the /etc path, including Context Hub configurations, it is often necessary to re-apply these changes after the upgrade. While the upgrade will make a backup copy of any changes that it cannot merge under /var, we recommend backing up these changes manually before beginning the upgrade.

Generate The quickstart.properties File

When starting AEM from the jar file, a quickstart.properties file will be generated under crx-quickstart/conf. If AEM has only been started with the start script in the past, this file will not be present and the upgrade will fail. Make sure to check for the existence of this file and restart AEM from the jar file if it is not present.

Configure Workflow and Audit Log Purging

The WorkflowPurgeTask and com.day.cq.audit.impl.AuditLogMaintenanceTask tasks require separate OSGi configurations and will not work without them. If they fail during pre-upgrade task execution, missing configurations is the most likely reason. Therefore, make sure to add OSGi configurations for these tasks or remove them altogether from the pre-upgrade optimization tasks list if you do not wish to run them. Documentation for configuring workflow purging tasks can be found at Administering Workflow Instances and audit log maintenance task configuration can be found at Audit Log Maintenance in AEM 6.

Install, Configure, and Run The Pre-Upgrade Tasks

Because of the level of customization AEM allows, environments usually do not adhere to a uniform way of performing upgrades. This makes creating a standardized procedure for upgrades a difficult process.

In previous versions, it was also difficult for AEM upgrades that were stopped or that have failed to be safely resumed. This led to situations where restarting the full upgrade procedure was necessary or where defective upgrades were carried out without triggering any warnings.

In order to address these issues, Adobe has added several enhancements to the upgrade process, making it more resilient and user friendly. Pre-upgrade maintenance tasks that before had to be performed manually are being optimized and automated. Also, post-upgrade reports have been added so that the process can be fully scrutinized in the hope that any issues are found more easily.

Pre-upgrade maintenance tasks are currently spread over various interfaces which are partially or completely performed manually. The pre-upgrade maintenance optimization added to AEM 6.3 enables a unified way to trigger these tasks and be able to inspect their result on demand.

All tasks included in the pre-upgrade optimization step are compatible with all versions from AEM 6.0 onwards.

How to Set It Up

In AEM 6.3, the pre-upgrade maintenance optimization tasks come included in the quickstart jar. If you are upgrading from an older version of AEM 6, they are made available through separate packages that you can download from the Package Manager.

DataStoreGarbageCollectionTask is calling a Datastore Garbage Collection operation with the mark and sweep phase if used. For deployments that use a shared datastore make sure to either reconfigure it or properly or prepare the instance to avoid deletion of items referenced by another instance. This might require running the mark phase manually on all instances before triggering this pre-upgrade task.

Default Configuration of the Pre-Upgrade Health Checks

The PreUpgradeTasksMBeanImpl OSGI component comes pre-configured with a list of pre-upgrade health check tags to execute when the runAllPreUpgradeHealthChecks method is called:

system - the tag used by the granite maintenance health checks

pre-upgrade - this is a custom tag that could be added to all the health checks that you can set to run before an upgrade

The list is editable. You can use the plus (+) and minus (-) buttons besides the tags to add more custom tags, or remove the default ones.

Going to the JMX Console at http://serveraddress:serverport/system/console/jmx

Search for PreUpgradeTasks and click the result

Select any method from the Operations section and select Invoke in the following window.

Below is a list of all the available methods that the PreUpgradeTasksMBeanImpl exposes:

Method Name

Type

Description

getAvailablePreUpgradeTasksNames()

INFO

Displays the list of available pre-upgrade maintenance tasks names.

getAvailablePreUpgradeHealthChecksTagNames()

INFO

Displays the list of pre-upgrade health checks tag names.

runAllPreUpgradeTasks()

ACTION

Runs all the pre-upgrade maintenance tasks in the list.

runPreUpgradeTask(preUpgradeTaskName)

ACTION

Runs the pre-upgrade maintenance task with the name given as the parameter.

isRunAllPreUpgradeTaskRunning()

ACTION_INFO

Checks if the runAllPreUpgradeTasksmaintenance task is currently running.

getAnyPreUpgradeTaskRunning()

ACTION_INFO

Checks if any pre-upgrade maintenance task is currently running and
returns an array containing the names of currently running tasks.

getPreUpgradeTaskLastRunTime(preUpgradeTaskName)

ACTION

Displays the exact running time of the pre-upgrade maintenance task with the name given as the parameter.

getPreUpgradeTaskLastRunState(preUpgradeTaskName)

ACTION

Displays the last running state of the pre-upgrade maintenance task with the name given as the parameter.

runAllPreUpgradeHealthChecks(shutDownOnSuccess)

ACTION

Runs all the pre-upgrade health checks and saves their status in a file named preUpgradeHCStatus.properties that is located in the sling home path. If the shutDownOnSuccess parameter is set to true, the AEM instance will be shut down, but only if all the pre-upgrade health checks have an OK status.

The properties file will be used as a precondition for any future upgrade
and the upgrade process will be stopped if the pre-upgrade health check
execution failed. If you want to ignore the result of the pre-upgrade
health checks and launch the upgrade anyway, you can delete the file.

detectUsageOfUnavailableAPI(aemVersion)

ACTION

Lists all the imported packages that will no longer be satisfied when
upgrading to the specified AEM version. The target AEM version must be
given as parameter.

Opomba:

The MBean methods can be invoked via:

The JMX Console

Any external application that connects to JMX

cURL

Disable Custom Login Modules

Opomba:

This step is only required if you are upgrading from an AEM 5 version. It can be skipped entirely for upgrades from older AEM 6 versions.

The way custom LoginModules are configured for authentication at the repository level has fundamentally changed in Apache Oak.

In AEM versions that used CRX2 configuration was placed in the repository.xml file, while from AEM 6 onwards it is done in the Apache Felix JAAS Configuration Factory service via the Web Console.

Therefore, any existing configurations will have to be disabled and re-created for Apache Oak after the upgrade.

To disable the custom modules defined in the JAAS configuration of repository.xml, you need to modify the configuration to make use of default LoginModule, as in this example:

Remove Updates From The /install Directory

Remove any service packs, feature packs or hotfixes that have been deployed through the crx-quickstart/install directory. This will prevent the inadvertent installation of old hotfixes and service packs on top of the new AEM version after the update has completed.

Stop Any Cold Standby Instances

If using TarMK cold standby, stop any cold standby instances. These will guarantee an efficient way to come back online in case of issues in the upgrade. After the upgrade has completed successfully, the cold standby instances will need to be rebuilt from the upgraded primary instances.

Disable Custom Scheduled Jobs

Disable any OSGi scheduled jobs that are included in your application code.

Execute Offline Revision Cleanup

Opomba:

This step is only necessary for TarMK installations

If using TarMK, you should execute Offline Revision Cleanup before upgrading. This will make the repository migration step and subsequent upgrade tasks execute much faster and will help to ensure that Online Revision Cleanup can execute successfully after the upgrade has completed. For information on running Offline Revision Cleanup, see Performing Offline Revision Cleanup.

Execute Datastore Garbage Collection

Opomba:

This step is only necessary for instances running crx3

After running revision cleanup on CRX3 instances, you should run Datastore Garbage Collection to remove any unreferenced blobs in the data store. For instructions, see the documentation on Data Store Garbage Collection.

Rotate Log Files

We recommend archiving your current log files before beginning your upgrade. This will make it easier to monitor and scan your log files during and after the upgrade to identify and resolve any issues that may occur.