For upgrades to AEM 6.3, Adobe has provided a pre-upgrade task package to make the process easier on implementers.
The main task is runAllPreUpgradeTask(), which takes care of executing Revision Cleanup, Version Purge, Workflow Purge, Audit Log Maintenance, and Generate Bundle List File.
When I ran runAllPreUpgradeTask(), it started the process, but after a while, I looked at the error.log file. And I found the process had failed. I saw the below error message:
12.09.2017 18:06:05.107 ERROR [sling-threadpool-fcbead40-0eb8-407a-a17a-94049576e634-(apache-sling-job-thread-pool)-9-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl RunAllPreUpgradeTasks task failed.
What does this error message mean, exactly? Well, it meant that one or more of the pre-configured tasks had failed.
How do we find out which pre-configured task is failing? The answer lies in the error.log. By looking more closely at the error.log, I found that the Workflow Purge and Audit Log Maintenance tasks were not configured in the instance.
See the below error message:
12.09.2017 18:05:52.043 ERROR [Thread-19] com.adobe.granite.maintenance.impl.TaskScheduler Maintenance task WorkflowPurgeTask failed
Full log: No purge configurations configured
12.09.2017 18:05:57.063 ERROR [Thread-14] com.adobe.granite.maintenance.impl.TaskScheduler Maintenance task AuditLogMaintenanceTask failed with message: No purge configurations configured
To fix this problem, configure the Workflow Purge and Audit Log Maintenance tasks in Configuration Manager.
Once you configure the above configuration, re-run the runAllPreUpgradeTask() and check your error.log. You should see the successful message as shown below:
9.2017 18:38:30.200 INFO [sling-threadpool-fcbead40-0eb8-407a-a17a-94049576e634-(apache-sling-job-thread-pool)-17-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl WorkflowPurgeTask task finished running successfully.
12.09.2017 18:38:35.253 INFO [sling-threadpool-fcbead40-0eb8-407a-a17a-94049576e634-(apache-sling-job-thread-pool)-17-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl com.day.cq.audit.impl.AuditLogMaintenanceTask task finished running successfully.
12.09.2017 18:38:40.275 INFO [sling-threadpool-fcbead40-0eb8-407a-a17a-94049576e634-(apache-sling-job-thread-pool)-17-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl RunAllPreUpgradeTasks task finished running successfully.