<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarai.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Clean audit tables?</title><link>https://sugarclub.sugarai.com/dev-club/f/questions-answers/7670/clean-audit-tables</link><description>We have been using Sugar for more than 6 years. We have audit log records that go back to the start of our use of Sugar. The Archive Data tool does not have the ability to archive audit tables. What is the best practice to remove older data from these</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/32221?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 16:56:58 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:e2c2e2dc-d194-49d0-b2c5-3cfecb9c9e27</guid><dc:creator>Luke Ridgway</dc:creator><description>&lt;p&gt;That&amp;#39;s interesting&lt;a class="internal-link view-user-profile" href="/members/frinaldi"&gt; Fr&amp;eacute;d&amp;eacute;ric Rinaldi&lt;/a&gt;...&lt;br /&gt;I was following the Support advice via the case too.&lt;br /&gt;So yes:&amp;nbsp;&lt;em&gt;&amp;nbsp;it would be great that this cleaning (as the core prune jobs) will be a part of the Sugar solution.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/32215?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 07:12:45 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:06238f9c-7fba-48ff-88f5-40d9e75f2eb6</guid><dc:creator>Fr&amp;#233;d&amp;#233;ric Rinaldi</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/luke-ridgway"&gt;Luke Ridgway&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the problem with that kind of basic cleaning is that your BPM can&amp;#39;t be defined to run only once. So if you delete the previous execution trace, it can be triggered again.&lt;/p&gt;
&lt;p&gt;Same for audit ;&amp;nbsp;it could be great to keep the last change of a field instead of cleaning the full table ; furthermore, with GDPR / Data Privacy, the audit seems to be used to provide the last user that set the field.&lt;/p&gt;
&lt;p&gt;But of course, those tables (audit and pmse working tables) need to be cleaned for performance and DB sizing (even more on the cloud) and it would be great that this cleaning (as the core prune jobs) will be a part of the Sugar solution.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Fred&lt;/p&gt;
&lt;div id="ext-mouse-move"&gt;&lt;/div&gt;
&lt;div id="ext-mouse-down"&gt;&lt;/div&gt;
&lt;div id="ext-mouse-up"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/32207?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2024 17:35:00 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:69be0315-445a-4334-9c80-eb6e0feb4a00</guid><dc:creator>Luke Ridgway</dc:creator><description>&lt;p&gt;I raised a case with support and they trimmed the&amp;nbsp;&lt;span&gt;pmse_bpm table for us (sell, cloud, 14.0 back then, now 14.2). &lt;br /&gt;Everything older than a month.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That seemed to have had a great effect in reducing the DB storage by&amp;nbsp; 3.7GB...!&lt;br /&gt;&lt;br /&gt;I also noticed that when I view the Process List (/#pmse_Inbox/layout/casesList) it&amp;#39;s lightning fast... previously I would open it, go and do something else for a bit, then come back to it. So this is a nice improvement too.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This was&amp;nbsp;in reply to my question/case:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;There is no way via the UI to delete data from a pmse_bpm table. This is on purpose as the data within those tables control moving processes in your instance and deleting something incorrectly can result in lots of problems. The size of your pmse_bpm_flow table is quite typical, but I&amp;#39;d be happy to trim it for you to reduce size if that&amp;#39;s okay with you.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/32198?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2024 22:32:06 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:c4241b89-e312-4f8b-99a1-2009d4a9eb64</guid><dc:creator>Ben Hamilton</dc:creator><description>&lt;p&gt;However it would be FANTASTIC if the Archive Data tool did clean out audit tables as well&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/32197?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2024 22:30:26 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ba3ff63a-8cf7-4cb4-85c7-89e4f15a0aa3</guid><dc:creator>Ben Hamilton</dc:creator><description>&lt;p&gt;For Sugar Cloud, I&amp;#39;ve been asking support to run the following script, by making all intervals in MONTH units, I can then, depending on the clients desire, I do a search and replace on the number of months, i.e. 12 MONTH, or 36 MONTH... &lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="sql"&gt;-- clean out (most but not all) audit tables in SugarCRM older than x months
-- Search and replace `12 MONTH` with timeframe you desire to keep

DELETE FROM accounts_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE accounts_audit;

DELETE FROM audit_events
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE audit_events;

DELETE FROM bugs_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE bugs_audit;

DELETE FROM business_centers_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE business_centers_audit;

DELETE FROM calls_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE calls_audit;

DELETE FROM campaigns_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE campaigns_audit;

DELETE FROM cases_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE cases_audit;

DELETE FROM cj_forms_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE cj_forms_audit;

DELETE FROM contacts_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE contacts_audit;

DELETE FROM contracts_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE contracts_audit;

DELETE FROM data_privacy_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE data_privacy_audit;

DELETE FROM document_merges_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE document_merges_audit;

DELETE FROM document_templates_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE document_templates_audit;

DELETE FROM documents_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE documents_audit;

DELETE FROM docusign_envelopes_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE docusign_envelopes_audit;

DELETE FROM dri_workflows_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE dri_workflows_audit;

DELETE FROM email_addresses_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE email_addresses_audit;

DELETE FROM escalations_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE escalations_audit;

DELETE FROM forecast_manager_worksheets_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE forecast_manager_worksheets_audit;

DELETE FROM kbcontent_templates_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE kbcontent_templates_audit;

DELETE FROM kbcontents_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE kbcontents_audit;

DELETE FROM leads_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE leads_audit;

DELETE FROM messages_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE messages_audit;

DELETE FROM manufacturers_audit
WHERE date_entered &amp;lt; NOW() - INTERVAL 12 MONTH; -- date_entered
OPTIMIZE TABLE manufacturers_audit;

DELETE FROM meetings_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE meetings_audit;

DELETE FROM messages_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE messages_audit;

DELETE FROM metrics_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE metrics_audit;

DELETE FROM notes_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE notes_audit;

DELETE FROM notifications_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE notifications_audit;

DELETE FROM opportunities_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE opportunities_audit;

DELETE FROM pmse_inbox
WHERE date_entered &amp;lt; NOW() - INTERVAL 12 MONTH; -- date_entered
OPTIMIZE TABLE pmse_inbox;

DELETE FROM product_templates_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE product_templates_audit;

DELETE FROM products_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE products_audit;

DELETE FROM project_task_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE project_task_audit;

DELETE FROM prospects_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE prospects_audit;

DELETE FROM purchased_line_items_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE purchased_line_items_audit;

DELETE FROM quotas_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE quotas_audit;

DELETE FROM quotes_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE quotes_audit;

DELETE FROM report_schedules_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE report_schedules_audit;

DELETE FROM revenue_line_items_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE revenue_line_items_audit;

DELETE FROM shifts_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE shifts_audit;

DELETE FROM tags_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE tags_audit;

DELETE FROM tasks_audit
WHERE date_created &amp;lt; NOW() - INTERVAL 12 MONTH;
OPTIMIZE TABLE tasks_audit;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/32001?ContentTypeID=1</link><pubDate>Sun, 29 Sep 2024 01:51:31 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:071ce906-39b2-4333-b3f7-69ab75e4cbfd</guid><dc:creator>Francesca Shiekh</dc:creator><description>&lt;p&gt;Yet. &lt;span class="emoticon" data-url="https://sugarclub.sugarai.com/cfs-file/__key/system/emoji/1f606.svg" title="Laughing"&gt;&amp;#x1f606;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/31999?ContentTypeID=1</link><pubDate>Sat, 28 Sep 2024 13:05:15 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:3508c02b-3cb5-455d-aeb3-5a78e93e662f</guid><dc:creator>Chris Raffle</dc:creator><description>&lt;p&gt;We don&amp;#39;t have a plugin&amp;nbsp;to delete/archive audit data at this time&amp;nbsp;&lt;span class="emoticon" data-url="https://sugarclub.sugarai.com/cfs-file/__key/system/emoji/1f605.svg" title="Sweat smile"&gt;&amp;#x1f605;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clean audit tables?</title><link>https://sugarclub.sugarai.com/thread/31997?ContentTypeID=1</link><pubDate>Fri, 27 Sep 2024 20:14:16 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:d5b20cc4-1cb4-417a-b3c1-768a426a8473</guid><dc:creator>Francesca Shiekh</dc:creator><description>&lt;p&gt;I can&amp;#39;t think of anything out of the box. Of course you can always build a custom scheduler to delete older records.&lt;/p&gt;
&lt;p&gt;Maybe Upsert has something to take care of this? &lt;a href="/members/rifa"&gt;Chris Raffle&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;
&lt;p&gt;FrancescaS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>