August 19, 2020
Estimated Post Reading Time ~

How to Restore AEM Instances using Journal Log in AEM ?

As an AEM developer, we try multiple things in our local instance and there is a high chance of instances getting corrupted once in a while. Ever wondered how easy it is to restore AEM instances using the journal log? If not, then this blog is for you.

This blog describes how to restore our AEM instance to a specific time using the Journal log. The default configuration of the journal theoretically allows for an unlimited number of rotated log-files. Due to some older issues in Oak or some inconsistencies in the repository, a segment can go missing and repository might be inconsistent. 

Steps to Implement the Journal Log in AEM
Usually, the journal log file is located under /crx-quickstart/repository/segmentstore and the entries in the journal log have epoch timestamp (Unix timestamp ex: 1592560809149, 1592560959133).
Stop the AEM instance.
Open the journal log file and copy the last epoch timestamp entry and convert it to a human-readable timestamp using https://www.epochconverter.com/.
Identify the time frame when your AEM was running fine. There are a couple of ways to do it. Two of them are:
Run the consistency check
java -jar oak-run-*.jar check -d1 –bin=-1 -p crx-quickstart/repository/segmentstore/
After you run this command in a terminal, look for the log entry which says “Found latest good revision: a0bf25e0-7c8b-44c7-acca-7a8066e83107:206” and then tries to find this entry in journal log and delete all the entries beneath.
Randomly try to find the nearest epoch timestamp from the journal log which matches our time frame when AEM was in good condition (like 1 day ago or 2 ago days ago) and then delete the bottom entries from the log.
Save the journal log and start the AEM.
Output:





This could potentially save a lot of time and effort from an AEM developer debugging the local AEM instances. I hope this helps.




By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.