<html><head><style>body{font-family:Helvetica Neue,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica Neue,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Hi Alexander,</div><p class="airmail_on">On 2015年11月24日 at 9:52:37, Alexander B. Zubkov (<a href="mailto:info@zubkov.info">info@zubkov.info</a>) wrote:</p> <div><div><div><blockquote type="cite" class="clean_bq" style="font-family: 'Helvetica Neue', Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><div bgcolor="#FFFFFF" text="#000000"><div></div><div><font face="Helvetica, Arial, sans-serif">Hi!<br><br>Sorry for bothering you. I installed ExternalStorage plugin for RT but it does not help much, it takes out of DB less than 15% (996Mb in DB, 143Mb on disk). I really expected every attachment should be moved. I took a look at source code and I don't understand a few things:</font></div></div></span></blockquote></div><p>I’m happy to report that in 4.4, we moved the ExternalStorage extension into core as a standard RT feature. As part of that I cleaned up many of the issues you ran into:</p><div><blockquote type="cite" class="clean_bq" style="font-family: 'Helvetica Neue', Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><div bgcolor="#FFFFFF" text="#000000"><div><font face="Helvetica, Arial, sans-serif"><br><br>1)<br>            $attach->Limit(<br>                FIELD     => 'ContentType',<br>                OPERATOR  => 'NOT STARTSWITH',<br>                VALUE     => $_,<br>                SUBCLAUSE => 'applies',<br>                ENTRYAGGREGATOR => "AND",<br>            ) for "text/", "message/", "image/", "multipart/";<br><br>Are you intentionally skipping images? Why? Documentation say images should be moved.</font></div></div></span></blockquote></div></div><p>The code has been refactored in core. Image attachments are not skipped.</p><div><blockquote type="cite" class="clean_bq" style="font-family: 'Helvetica Neue', Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><div bgcolor="#FFFFFF" text="#000000"><div><font face="Helvetica, Arial, sans-serif"><br><br>2)<br>    } elsif ($type =~ m{^image/}) {<br>        # Ditto images, which may be displayed inline<br>        return 1 if $length > 10 * 1024 * 1024;<br>        return 0;<br><br>It means any file less than 10Mb will not be moved? Does it make sense?</font></div></div></span></blockquote></div></div><p>Correct. However, in the cored version of ExternalStorage, this is now configuration (ExternalStorageCutoffSize) so you can tune it down to 500kb or whatever threshold makes sense for you.</p><div><div><blockquote type="cite" class="clean_bq" style="font-family: 'Helvetica Neue', Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><div bgcolor="#FFFFFF" text="#000000"><div><font face="Helvetica, Arial, sans-serif">I tried to patch to 10Kb (10 * 1024) in 3 places. After that a few more files (about 20) were moved but still so much data is in DB. But I have a 26k tickets archive, it looks like it processes only tickets from last day but I would like it to process ALL attachments from very beginning.</font></div></div></span></blockquote></div><p>This is because we maintain a high water mark for avoiding processing the same attachments over and over and over again.</p><div><div><blockquote type="cite" class="clean_bq" style="font-family: 'Helvetica Neue', Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><div bgcolor="#FFFFFF" text="#000000"><div><font face="Helvetica, Arial, sans-serif">So is it possible somehow to force this plugin to move all images and other files out of DB? Thanks.</font></div></div></span></blockquote></div><p>If you *temporarily* change the line in the script (extract-attachments in the extension, rt-externalize-attachments in 4.4):</p><p>$last = $last ? $last->Content : {};</p><p>to just</p><p>$last = {};</p><p>it should re-process all attachments. It won’t re-externalize attachments that were already externalized.</p><p><br></p><p>Hope this helps,</p><p>Shawn</p></div></div></body></html>