- Download the oak-run-x.jar file where x matches the version of Oak used on your system: https://repo1.maven.org/maven2/org/apache/jackrabbit/oak-run/
- Stop all AEM/Oak instances.
- Upload the oak-run version to the AEM server if using TarMK or MongoDB server (if using MongoMK).
- Run this command to start the oak console.
- on TarMK:
java -jar oak-run.jar console --quiet /path/to/segmentstore --read-write
- For MongoMK run this:
java -jar oak-run.jar console mongodb://localhost/aem-author --read-write
- The oak-run console shell should start and you will see a prompt.
Run commands (in the oak-run console shell) to set a property or remove a property on a node
:load propertyUtils.groovy
setProperty(session, "/path", "propName", "propValue", false)
rmProperty(session, "/path", "propName")
Run commands (in the oak-run console shell) to remove or rename a node
:load nodeUtils.groovy
rmNode(session, "/path/to/nodeToDelete")
mvNode(session, "/path/to/node", "newNameForNode")
addChildNode(session, "/path/to/node", "newChildNodeName", "nt:unstructured")