senaite.archive¶
This add-on enables records archiving for SENAITE LIMS, so users with enough privileges (Manager and LabManager) can shrink the size of the database and improve the overall performance of the system by archiving inactive objects that are outside of a predefined retention period in years.
senaite.archive extracts old objects from SENAITE and store them on the server’s filesystem in both human and machine readable format (XML), making forensic audits easier. Data is stored locally thanks to Zope’s genericsetup, so future recovery of records is also possible.
The types of records that can be archived are Samples (aka AnalysisRequest), together with all the information they contain (Analyses, reports, etc.), Batches and Worksheets.
Once installed, this add-on allows the laboratory to:
Define the retention period of data in years
Define the local directory where data will be stored for archiving purposes
Archive no longer active records that are outside of the retention period
Perform historic searches against archived records
Table of Contents:
Installation¶
To install senaite.archive in your SENAITE instance, simply add this add-on in your buildout configuration file as follows, and run bin/buildout afterwards:
[buildout]
...
[instance]
...
eggs =
...
senaite.archive
With this configuration, buildout will download and install the latest published release of senaite.archive from Pypi.
Once buildout finishes, start the instance, login with a user with “Site Administrator” privileges and activate the add-on:
http://localhost:8080/senaite/prefs_install_products_form
Note
It assumes you have a SENAITE instance listening to port 8080
Note
For high-demand instances, is strongly recommended to use this add-on together with senaite.queue. senaite.archive delegates the archiving of records to senaite.queue when installed and active. Otherwise, the archiving takes place in a single transaction.
Quickstart¶
This section gives an introduction about senaite.archive. It assumes you
have SENAITE LIMS and senaite.archive
already installed. Please read the
Installation for further details.
Control panel¶
Visit the control panel view for senaite.archive to configure the settings. This control panel is accessible to users with Site Administrator role, through “Site Setup” view, “Add-on Coniguration” section:
http://localhost:8080/senaite/@@archive-controlpanel
From this control panel view you can define the following settings:
Retention period *: the number of years you want to retain data for. Default: 2 (years).
Date criteria *: the date criteria used to check whether an electronic record is outside of the retention period. For instance, if the value is
created
, the system will consider for archival those non active records that were created before the retention period. Default: ‘created’Archive path *: the full path of the local directory where archived objects will be stored. User that runs the instance must have write access. The XML objects extracted from the system will be stored in this path, organized in a tree structure as follows: the top level directory represents the year when the objects where created and the directory below represents the week number within the year when the objects were created.
Archiving objects¶
Login as a SENAITE regular user with enough privileges to archive samples. Go to samples listing, click to the “Published”, “Cancelled” or “Invalid” statuses. Select the oldest sample that is outside of the retention period you’ve defined in the Archive settings (see previous section). A button “Archive” is displayed at the bottom of the list.
Same principle applies for Worksheets and Batches listings.

Although the archiving of individual objects is possible, the recommended approach is to archive all objects that are outside of the retention period automatically without the need of selecting them manually. Visit the “Archive” link at the left and press the button “Archive old records”.
The archived items will eventually be displayed in the archive items listing. Archived items are also searchable for historic purposes.
Changelog¶
1.0.0 (unreleased)¶
First version
License¶
SENAITE.ARCHIVE Copyright (C) 2021 RIDING BYTES & NARALABS
SENAITE.ARCHIVE is available under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
The source code of this software, together with a copy of the license can be found at this repository: https://github.com/senaite/senaite.archive
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.