Nuxeo Server

Deleting Documents

This page is scheduled for review and update. Check back soon for updated content!

Deleting a document involves several steps before the full document is actually deleted from the database and disk. These steps are described below.

Functional Overview

Technical Overview

Putting the Document in the Trash

Putting a document in the trash is done by changing is lifecycle state to deleted, by following the delete transition of the document's lifecycle. If no such lifecycle exists for the document, then it won't be put in the trash at all but will be immediately permanently deleted using the steps below.

When the trash is purged, all its documents are permanently deleted.

Besides the standard user interface, a document is put in the trash when using WebDAV, Nuxeo Drive, or using the TrashService.trashDocuments API.

Permanently Deleting the Document

A permanent delete is done by most Nuxeo APIs, typically CoreSession.removeDocument or the higher-level APIs that use it like the CMIS bindings or the Automation Document.Delete operation.


If soft-delete is enabled (this is not the case by default), then the document is marked as deleted in the database (using a simple boolean flag) but no rows are actually removed. A search will not be able to find any document marked deleted in this way. From the application's point of view, the document is already fully deleted.

A scheduled periodic process will then hard-delete the documents marked as deleted at a later time, for asynchronous cleanup in fixed-sized batches.

Using Soft-Delete

Soft-delete is available for VCS only.

Soft-delete can be enabled to relieve the database of expected heavy loads if many documents are deleted at the same time.

When Nuxeo has to hard-delete lots of documents, many rows in many tables, themselves related by foreign key constraints, have to be removed. On some databases this can use many resources (like undo segments for Oracle) and take a lot of time, so soft-delete is designed to spread these costly operations over time.

To activate soft-delete, you should change the repository configuration to add <softDelete enabled="true" /> . See Configuration Templates for more about updating the default-repository-config.xml.nxftl file.

Please consult NXP-11335 for more details about soft-delete and the configuration of the periodic cleanup.


If soft-delete is not enabled, or when the periodic cleanup process for soft-delete happens, the document's data is actually physically deleted from the database by using DELETE SQL statements (or equivalent calls for non-VCS storages).

Other Related Documentation
2 months ago Manon Lumeau S3 direct upload: specify the minimum right the IAM role must have
3 years ago Solen Guitter 12
4 years ago Manon Lumeau 11
4 years ago Manon Lumeau 10
4 years ago Solen Guitter 8
4 years ago Solen Guitter 9
4 years ago Solen Guitter 7 | Update related pages, move Garbage-Collecting Orphaned Binaries in ADMINDOC, formatting
4 years ago Julien Carsique 6
5 years ago Alain Escaffre 5
5 years ago Florent Guillaume 4 | soft-delete details
5 years ago Solen Guitter 3
5 years ago Florent Guillaume 2
5 years ago Florent Guillaume 1
History: Created by Florent Guillaume

We'd love to hear your thoughts!

All fields required