A note from 2026: This article was published in 2018 and refers to SAP hybris 6.6. The product is now SAP Commerce Cloud, the hybris branding has been phased out, and HMC/Product Cockpit-era tooling has been deprecated in favor of Backoffice and newer administration tools.

In hybris 6.6, almost all project-specific files are located in a special folder called the “data folder.” The structure of this folder is not well documented. The folders and files have “random” names. Basically, this is not very important until you find that this folder is too large. Understanding its structure and the purpose of its components will help you troubleshoot and optimize the system.

The official hybris documentation explains some technical aspects, but rather briefly. In this article, I’m trying to look deeper.

Location

The Hybris Data Dir is specified in env.properties:

HYBRIS_BIN_DIR=${platformhome}/../../bin
HYBRIS_CONFIG_DIR=${platformhome}/../../config
HYBRIS_DATA_DIR=${platformhome}/../../data
HYBRIS_LOG_DIR=${platformhome}/../../log
HYBRIS_TEMP_DIR=${platformhome}/../../temp/hybris

Structure

The data folder contains runtime data:

  1. Accelerator Services Batch Impex Base Folder for import and export. By default, it is DATADIR/acceleratorservices/import and DATADIR/acceleratorservices/export. Configurable via acceleratorservices/project.properties.
  2. Tomcat runtime files (wrapper.conf), such as:
    • status file (hybristomcat.java.status),
    • process ID files (hybristomcat.java.idfile and hybristomcat.java.pidfiles),
    • lock file (hybristomcat.lock).
  3. HSQLDB data files (/hsqldb; configurable; platform/project.properties)
  4. SOLR data files (solr/; configurable; solrserver/buildcallbacks.xml)
  5. Swagger Maven plugin output directory docs (/doc; by webservicecommons)
  6. Media replication directory (/media; configurable; media.replication.dirs in advanced.properties). Deprecated.
  7. Media read directory (/media; configurable; media.read.dir in advanced.properties)
    1. sys_master/ – for the default tenant “master”
      1. All files here are referenced files; for example, there is an object (item) referencing the file.
    2. sys_junit/ – for the default tenant “junit”
  8. Lucene Index (/luceneindex; configurable; lucenesearch.indexdir in advanced.properties)

How to access the data folder from the code

Media

Storage strategy

The storage strategy defines how hybris sources and organizes media files, such as images or documents. The relevant configuration parameter is <PREFIX>.storage.strategy.

There are four out-of-the-box storage strategies:

In this document, I am focusing on LocalFileMediaStorageFactory. In this strategy, all data is stored locally in local file system storage defined by the media.read.dir and media.replication.dirs configuration properties.

See the section “Configuration Parameters Prefix” below to learn more about what <PREFIX> is.

Local cache

The local cache is a way of speeding up the delivery of media files by caching them in memory. Caching is implemented via the region cache framework. By default, the configuration parameter <PREFIX>.local.cache specifies whether data from non-local strategies is cached or not.

There is a parameter, <PREFIX>.local.cache.rootCacheFolder. It specifies a root cache folder for all cached files. <PREFIX>.local.cache.maxSize is used to specify the maximum size of the media cache, in megabytes.

See the section “Configuration Parameters Prefix” below to learn more about what <PREFIX> is.

Local File Hierarchy

The file name of the media file consists of two parts:

So you can list all PKs of all stored media by listing all files in the media folder and compare them with the PKs stored in the database to see if there are any differences.

A typical file name looks like 9593242157086.xml.

The file path consists of two parts:

Typical file paths:

The full path will look like this:

Example of a full media file path in the SAP hybris data folder

Media folders

A media folder is one of the parameters for the media when it is created. However, there are a number of predefined folders:

Hashing depth

The hashing depth is the number of levels in the hierarchy (see the “hash part” above) used to limit the number of files per directory. By default, the configuration parameter hashing.depth is 2. You can change it in the configuration.

For building a hash value, hybris uses “salt” as a parameter. Different values of “salt” lead to different hashes. This value is specified by the configuration parameter <PREFIX>.storage.location.hash.salt. The value of this salt is the same for all installations; at least versions 6.2 and 6.6 have the same value hardcoded in the configuration.

See the section “Configuration Parameters Prefix” below to learn more about what <PREFIX> is.

Configuration Parameters Prefix

The configuration settings can be specified globally or for a particular folder. Some values can be marked as default. So, all mentioned configuration parameters start with <PREFIX>, which is one of the following values:

Abandoned media and other special cases