oo

File Storage

All files uploaded to Liferay DXP are stored in the instance’s designated file store. This includes files uploaded using Documents and Media, as well as those uploaded using applications that support file attachments (e.g., Message Boards). The file store can be hosted on the local machine, on a network mounted file system, in a database, or in the cloud.

important

If you are going to production, we highly recommend reviewing the various File Store configuration options and choosing the one that best fits your needs, before going live. Doing so can avoid painful file store migrations later in a project’s life.

note

The file store is also known as the Document Library.

Configuring Advanced File System Store

The Advanced File System Store programmatically creates a folder structure that can expand to millions of files, by alphabetically nesting the files in folders. This allows more files to be stored and helps to avoid the limitation that some operating system have on the number of files that can be stored per folder. Storing fewer files per folder also improves file lookup performance.

Advanced File System Store folder structure

To use the Advanced File System store method, following these steps:

  1. Configure portal-ext.properties with this property:

    dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
    
  2. Restart Liferay.

  3. In the Control Panel, navigate to ConfigurationSystem SettingsFile Storage.

  4. In the Advanced File System Store screen, set the Root Directory to your Liferay Home path (absolute or relative).

    Advanced File System Store screen

  5. Click Save.

Liferay is now saving files using Advanced File System Store.

File Storage in a Clustered Environment

In a clustered environment, point the store to a network mounted file system that all the nodes can access. The networked file system must be accessible to all nodes, support concurrent requests, and support file locking. If Advanced File System Store is used without such a file system and multiple users attempt writing to the same file concurrently, data corruption can occur.

Other File Storage Topics

Other File Storage Methods

There are other built-in file storage methods available.

warning

File system based stores (Simple, Advanced, S3) do not have transaction rollback capability. If a database transaction rollback occurs in a Document Library, the transaction’s file system changes are not reversed. Inconsistencies between Document Library files and those in the file system store can occur and may require manual synchronization. All stores except DBStore are vulnerable to this limitation.

Migrating Files Across File Stores

The Data Migration utility moves files from one store option to another. For example, it can be used to migrate files from a Simple File System Store (the default store) to an Advanced File System Store to leverage performance and scalability benefits. See File Store Migration for more information.