RT::Extension::ExternalStorage - Store attachments outside the database
Set( @Plugins, 'RT::Extension::ExternalStorage' ); Set(%ExternalStorage, Type => 'Disk', Path => '/opt/rt4/var/attachments', );
By default, RT stores attachments in the database. This extension 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 bin/extract-attachments script, to be run regularly via cron, takes care of moving attachments out of the database at a later time.
bin/extract-attachments
perl Makefile.PL
make
make install
May need root permissions
If you are using RT 4.2 or greater, add this line:
Plugin('RT::Extension::ExternalStorage');
For RT 4.0, add this line:
Set(@Plugins, qw(RT::Extension::ExternalStorage));
or add RT::Extension::ExternalStorage to your existing @Plugins line.
RT::Extension::ExternalStorage
@Plugins
You will also need to configure the %ExternalStorage option, depending on how and where you want your data stored; see "CONFIGURATION".
%ExternalStorage
Restarting the webserver before the next step (extracting existing attachments) is important to ensure that files remain available as they are extracted.
Run bin/extract-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 bin/extract-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/rt4/local/plugins/RT-Extension-ExternalStorage/bin/extract-attachments
This module comes with a number of possible backends; see the documentation in each for necessary configuration details:
This extension is not currently compatibile with RT's shredder tool; attachments which are shredded will not be removed from external storage.
shredder
Best Practical Solutions, LLC <modules@bestpractical.com>
All bugs should be reported via email to
L<bug-RT-Extension-ExternalStorage@rt.cpan.org|mailto:bug-RT-Extension-ExternalStorage@rt.cpan.org>
or via the web at
L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-ExternalStorage>.
This extension is Copyright (C) 2009-2015 Best Practical Solutions, LLC.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
To install RT::Extension::ExternalStorage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RT::Extension::ExternalStorage
CPAN shell
perl -MCPAN -e shell install RT::Extension::ExternalStorage
For more information on module installation, please visit the detailed CPAN module installation guide.