RT 5.0.2 Documentation
RT::ExternalStorage
NAME
RT::ExternalStorage - Store attachments outside the database
SYNOPSIS
Set(%ExternalStorage,
Type => 'Disk',
Path => '/opt/rt5/var/attachments',
);
DESCRIPTION
By default, RT stores attachments in the database. ExternalStorage moves all attachments that RT does not need efficient access to (which include textual content and images) to outside of the database. This may either be on local disk, or to a cloud storage solution. This decreases the size of RT's database, in turn decreasing the burden of backing up RT's database, at the cost of adding additional locations which must be configured or backed up. Attachment storage paths are calculated based on file contents; this provides de-duplication.
The files are initially stored in the database when RT receives them; this guarantees that the user does not need to wait for the file to be transferred to disk or to the cloud, and makes it durable to transient failures of cloud connectivity. The provided sbin/rt-externalize-attachments
script, to be run regularly via cron, takes care of moving attachments out of the database at a later time.
SETUP
Edit /opt/rt5/etc/RT_SiteConfig.pm
You will need to configure the %ExternalStorage
option, depending on how and where you want your data stored.
RT comes with a number of possible storage backends; see the documentation in each for necessary configuration details:
Restart your webserver
Restarting the webserver before the next step (extracting existing attachments) is important to ensure that files remain available as they are extracted.
Extract existing attachments
Run sbin/rt-externalize-attachments
; this may take some time, depending on the existing size of the database. This task may be safely cancelled and re-run to resume.
Schedule attachments extraction
Schedule sbin/rt-externalize-attachments
to run at regular intervals via cron. For instance, the following /etc/cron.d/rt entry will run it daily, which may be good to concentrate network or disk usage to times when RT is less in use:
0 0 * * * root /opt/rt5/sbin/rt-externalize-attachments
CAVEATS
This feature is not currently compatible with RT's shredder
tool; attachments which are shredded will not be removed from external storage.