AEM Tips & Tricks

Repository Maintenance

AEMs TarMK can grow really huge. There’re ways to deal with it - trimming its size by either

The first approach is also known as garbage collection or offline tar compaction. The latter one is often more efficient and yields a smaller result size.

$> java -jar ~/crx2oak-1.6.8-all-in-one.jar --src-datastore=/opt/aem/datastore --datastore=$HOME/datastore-new --exclude=/var/audit --copy-versions=false segment-old:repository segment-old:$HOME/repository-new

Activate entire JCR Trees

AEMs publisher has a function called “Activate Tree”: http://:4501/etc/replication/treeactivation.html

Templates

When setting up a new site i relied on

pretty much

AEM & CLI

I started using Adobe AEM in January 2016.

This is a Collection of my findings and maybe they’re useful to somebody.

Where AEMs data lives

nb-syngeni350:author-cq61 vbe$ tree -L 2 -d
.
└── crx-quickstart
    ├── app
    ├── bin
    ├── conf
    ├── install
    ├── launchpad
    ├── logs
    ├── monitoring
    ├── opt
    └── repository    <-- Data lives here

One of my first learnings was that AEM uses a filebased datastore - called tarmk.

As per default everything you store in AEM stays there forever. Eventually stuff gets flagged as deleted - but still consumes space on your disk.

Move an AEM in filesystem

We had the need to move an installed AEM on the filesystem. I moved the entire AEM installation folder from one folder to another. I considered me done. I was not. AEM still started but the servers error.log contained a lot of (a that time) strange error messages. The reason was it couldn’t find the datastore aka repository.

The FileDataStore location can be changed in a file called

install/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg

with the content

path=$AEM_SERVERS/author-cq61/crx-quickstart/repository/repository/datastore
minRecordLength=4096

It should work with relative paths, too. But i haven’t tested it yet.

Status of all Bundles

curl --silent http://admin:admin@127.0.0.1:4502/system/console/bundles.json \
        |jq '.data[] | .state + ": " + .name + " (" + .version + ")"' -

Classic UI

HTL Template Language

Configuration

Configure Log-Files

You can manage log files using Web Console Loggers can be added, deleted and modified there

JCR Queries

List of Pages providing examples on how to query the JCR: