April 2, 2020
Estimated Post Reading Time ~

How to sanity check nodes across environments?

Introduction:
I would like to share another online tool called Node Diff. This tool helps to address some of the frequent questions I hear from most customers like
  • List of pages/assets that are on the publisher but not on author OR other various environments (DEV, QA, Pre-prod, DR, PROD ...)
  • How to ensure after activation all pages are activated.
  • After restoring how to sanity check quickly.....
Generally, an algorithm to achieve this is
  • Write a query that returns the results based on your situation.
  • Then create a service that utilizes the above query & returns the path.
  • Repeat the step on target and source instances
  • Then compare the results.
The above approaches work well but you need to deploy the code on all instances. Instead of how about making use of already inbuilt AEM crxde query service to get results and then use the online Node Diff tool from [1] simplify your job.

Solution:
  1. Write a query and use crxde query service to get json results. http://<host>:<port>/crx/de/query.jsp?_charset_=utf-8&type=xpath&stmt=<encoded_xpath_query>&showResults=true
  2. Repeat steps on two instances you want to compare & paste the JSON at [1].
Example:
you have noticed a bunch of pages that were not removed from the publisher's geometrixx website. To sanity-check, you need a list of pages that are on the publisher but not on the Author. The steps are
  • Login as admin it authors instance & executes query
  • http://localhost:4502/crx/de/query.jsp?_charset_=utf-8&type=xpath&stmt=%2Fjcr%3Aroot%2Fcontent%2Fgeometrixx%2Fen%2F%2Felement(*%2C%20cq%3APage)&showResults=true
  • Similarly at publish login as admin and execute the same query.
  • Paste the json at [1].
  • In filter select "Added" adn will list the pages that are on publisher but not on Author.


By aem4beginner

No comments:

Post a Comment

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