This article describes about how to restore our AEM application with our last good working revision using the Journal log.
We can use oak runnable to check and restore the last good revision into Oak’s working directory.
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.
Run consistency check on the repository and find the last good revision and revert back to it.
Journal log – please follow the below steps carefully:
You may download OAK from here: http://mvnrepository.com/artifact/org.apache.jackrabbit/oak-run
STEPS TO PERFORM
- Backup all files in./crx-quickstart/repository/segmentstore/
2.Run the consistency check
java -jar oak-run-*.jar check -d1 --bin=-1 -p crx-quickstart/repository/segmentstore/
It will search backwards through the revisions until it finds a consistent one:
Result of this step like: Found latest good revision ca9c71ae-1941-4a2d-aaed-c444db7a4c6d:260129
3. Revert the repository to this revision -Journal log
./crx-quickstart/repository/segmentstore/journal.log and deleting all lines after the line containing the latest good revision.
4. Remove all ./crx-quickstart/repository/segmentstore/*.bak files.
5. Run checkpoint clean-up to remove orphaned checkpoints:
java -jar /mnt/crx/author/oak-run-1.4.6.jar checkpoints /mnt/crx/author/crx-quickstart/repository/segmentstore java -jar oak-run-*.jar checkpoints ./crx-quickstart/repository/segmentstore rm-unreferenced
6.Finally compact the repository:
java -jar oak-run-*.jar compact ./crx-quickstart/repository/segmentstore/ You may like: AEM – Best Maintenance approaches Follow us in Facebook