Please note that the below information is given as is with no liability taken by PI or Patrix. Do not proceed to use the below information against your repository unless you are well aware of what you do. Also, before you proceed executing the audit log purging function, make sure you have a valid full backup of your DMS appliance.
General
Nuxeo maintains a full audit log of every user and/or system interaction with any document in the repository or it's associated metadata container. Over time, the audit log can grow to a very substantial size - potentially beyond the size of the repository data. The audit log is kept in the postgres database and thus, the database size can grow significantly. The audit log includes the history information for every document as can be accessed under then "History" tab for a document in the nuxeo console.
Starting with version 1.8 of the service container, it is possible to purge the nuxeo audit log up to a certain date by way of a purge script. In addition to this, after the log purging, the script performs a full vacuuming of the database incl. index rebuild in order to free the disk space the log took.
For maintenance purposes, it can also be advantageous to only run a full vacuuming of the database incl. index rebuild. This can help to optimise disk space and improve the db access speed.
Purging the audit log
Run a backup of your DMS appliance.
In order to run the purge script, run the following commands:
Run a bash inside the service container:
docker exec -it service bash
- Inside the container, run the purge script using the following commands:
/opt/clean_nxlog.sh <date>
<date>
defines a date in the format 'yyyy-mm-dd
'
which defines a cut-off date before which all logs will be purged. Following the purging action, the database will undergo a full vacuuming and reindexing process.
Note: It is advisable to run the above commands in a screen so as to avoid any disruption - which may cause irreparable damage - in case the connection to the DMS shell breaks.
Running a full vacuum and reindexing process only
Run a backup of your DMS appliance.
In order to start the vacuum and reindexing process, run the following commands:
Run a bash inside the service container:
docker exec -it service bash
- Inside the container, run the purge script using the following commands:
/opt/clean_nxlog.sh vacuum
The database will undergo a full vacuuming and reindexing process.
Note: It is advisable to run the above commands in a screen so as to avoid any disruption - which may cause irreparable damage - in case the connection to the DMS shell breaks.
Important
The purge script will remove log data from, inter alia, the nxp_logs table in the postgres database prior to the cut-off date. The immediate effect will be that all document history information in nuxeo before the cut-off date will be lost. It is important to understand that removal of the history information cannot be undone.
Depending on the jurisdiction in which the DMS is being operated, you may be obliged by law to (a) retain audit log information up to a certain date or, alternatively, (b) remove all auditing data after a certain retention period. Please make sure to observe the applicable legal frameworks.
Purging the nuxeo audit log, incl. fully vacuuming the database and rebuilding its indexes is very time consuming (up to and potentially beyond 1hr per 30GB of database size, depending on disk i/o). It is important that you schedule the audit log purging appropriately.