Phani Yadav


  1. Which is OOTB run mode applied at the time of installation of AEM instance?
    1. nosamplecontent
    2. author
    3. replicate
    4. loadsamplecontent
  2. How do you specify the osgi config of a java class in Publish runmode ?
    1. /apps/system/config/org.apache.felix.webconsole.internal.servlet.OsgiManager jcr:primary type= sling:osgiConfig
    2. /apps/system/config/org.apache.felix.webconsole.internal.servlet.OsgiManager.config jcr:primary type= sling:osgiConfig
    3. /apps/system/config/org.apache.felix.webconsole.internal.servlet.OsgiManager.config jcr:primary type= nt:file
    4. /apps/system/config/ jcr:primary type= nt:file
  3. You add “” in and start the instance using the command “java -jar aem-6-p4502.jar -r author”, In which mode will the instance start?
    1. Author
    2. Publish
    3. Due to conflict in the run modes, AEM will not start
    4. Both Author and Publish
  4. What is the correct order of precedence to set up run modes in AEM (from left to right,left being highest)
    1. system property,sling property,jar file
    2. jar file,sling property,system property
    3. sling property,jar file,system property
    4. jar file,system property,sling property
  5. Which three AEM jar names will start AEM in author mode?(choose three)
    1. cq5-author-4502.jar
    2. aem-publish.jar
    3. quickstart-4502.jar
    4. cq5-author-p4502.jar


AEM 6.2 User Migration

AEM Instance migration  is common in real world , Package manager does help when you want to move users and groups privileges from one AEM instance to another.

User Migration Steps :

  1. Go to package manager
  2. Create a package for user migration and add below filters and rules.
    • Add filter :  /home/users
    • Exclude Tokens : AEM implemented user token based authentication , all tokens will be stored under appropriate user node as rep:token node type.So we have to exclude tokens from package otherwise CRX will not allow to install package and throws javax.jcr.nodetype.ConstraintViolationException Exception.
    • Exclude Admin & Anonymous users : CRX doesn’t allow to move or delete admin users,As these users has lockable node property hence cannot be copied on destination instance.
    • Add rep:policy : All  Users ,resource based permissions will be stored in rep:policy nodes ,So add root rep:policy user permission node to package.migration
    1. Click save.
    2. Build the package and download.
  3. Unzip the package and open META-INF/vault/filter.xml in a text editor
    Add mode=”merge” to the filter tag, for example:
    [code language=”xml”]
    <?xml version="1.0" encoding="UTF-8"?>
    <workspaceFilter version="1.0">
    <filter root="/home/users" mode="merge">
    <exclude pattern="/home/users/a/admin"/>
    <exclude pattern="/home/users/a/anonymous"/>
  4. re-zip the package and install in new AEM instance .

Run Modes in AEM

Run modes in AEM allow you to configure AEM instances for specific purposes.
For example, We can configure environment specific OSGI Services meta data manually from felix console, But the problem here is whenever new build is deployed the OSGI meta data reset to default values , so again we have to configure. Instead of doing manually in felix console, we can create run mode config nodes in repository, sling will take these configuration automatically when we start the instance or config node update  based on run mode values.

Topics :

Run Mode types in AEM:

There are two types of run modes.

  1. Standard run modes – author,publish,samplecontent,nosamplecontent
  2. Custom run modes –  dev,qa,stage,prod ..etc.

Standard run modes set up:

We can configure standard run modes directly by renaming jar file ,Standard run modes are used at installation time and then fixed for the entire lifetime of the instance, they cannot be changed.

The naming convention to for AEM 5.6.1 and later is:


1. author – Run mode for author instance.
2. publish – Run mode for publish instance.
3. samplecontent – Run mode will install sample content.
4. nosamplecontent – Run mode will not install sample content.

Custom run modes set up:

We can define custom run modes different ways ,below are ways .

Using the file :

The file can be used to define the required run mode:

  1. Edit the configuration file:
  2. Add the following properties; the following example is for author:

Using the  -R option :

A custom run mode can be activated by using the -r option when launching the quickstart. For example, use the following command to launch a AEM instance with run mode set to dev.

java -jar cq-56-p4545.jar -r dev

Using a system property in the start script:

  • A system property in the start script can be used to specify the run mode.
    For example use the following to launch an instance as a production publish instance located in the US:,prod,us

Order of precedence of run modes:

Here my question is what happens if we did all above custom run mode configuration at a time,which one will take precedence .

below are the order of precedence of run modes.

  1. Start jar (by double clicking) – In this you do not have option to set run mode in, start script first time. JAR name takes precedence.
  2. Unpack jar and specify run mode as system properties in start script – JAR name doesn’t comes to picture here. In this you do not have option to set run mode in System properties takes precedence.
  3. Even if we change run mode in JAR name, it doesn’t changes the installation time run mode. For custom run mode, JAR file name is not applicable. Order of precedence is -> specifying -r option (command line jar option) -> system properties (start script).

Read Sling run modes in Java:

We can read sling run modes directly from SlingSettingsService OSGI service.

[code language=”java”] import;[/code]

[code language=”java”]@Reference
private SlingSettingsService slingSettingsService;[/code]

[code language=”java”]slingSettingsService.getRunModes(); [/code]


Powered by

Up ↑