{"id":266,"date":"2017-10-09T19:20:09","date_gmt":"2017-10-09T19:20:09","guid":{"rendered":"http:\/\/www.evermoretechnologies.com\/blog\/?p=266"},"modified":"2017-10-17T03:20:18","modified_gmt":"2017-10-17T03:20:18","slug":"clearing-magento-1-log-tables","status":"publish","type":"post","link":"https:\/\/www.evermoretechnologies.com\/blog\/2017\/10\/clearing-magento-1-log-tables\/","title":{"rendered":"Clearing Magento 1 log tables"},"content":{"rendered":"<p>Like all software, Magento 1 likes to log a lot of actions.  That is usually useful information and not a problem, but it can make for a larger database that you would like.  Especially if you need to copy the site to a new server or a local development environment.  Honestly, in my experience, I have rarely had to refer to these logs.<\/p>\n<p>For that reason, I have a way to clear out the log tables for smaller file transport.<\/p>\n<p>There are three ways to do this:<br \/>\n1. When logged into the admin, go to &#8220;System -> Configuration -> Advanced -> System -> Log.  Set the log clean time down to a small number.  By default on the sites I manage, it&#8217;s 180 days.  Something like one or two days would keep the tables pretty small.<br \/>\n2. Go straight to the database and truncate all of the log tables.  Below is the sql code that is tested and approved for this measure.<br \/>\n[code]<br \/>\nTRUNCATE dataflow_batch_export;<br \/>\nTRUNCATE dataflow_batch_import;<br \/>\nTRUNCATE log_customer;<br \/>\nTRUNCATE log_quote;<br \/>\nTRUNCATE log_summary;<br \/>\nTRUNCATE log_summary_type;<br \/>\nTRUNCATE log_url;<br \/>\nTRUNCATE log_url_info;<br \/>\nTRUNCATE log_visitor;<br \/>\nTRUNCATE log_visitor_info;<br \/>\nTRUNCATE log_visitor_online;<br \/>\nTRUNCATE report_viewed_product_index;<br \/>\nTRUNCATE report_compared_product_index;<br \/>\nTRUNCATE report_event;<br \/>\nTRUNCATE index_event;<br \/>\n[\/code]<\/p>\n<p>Keep your log tables clean for site transport.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like all software, Magento 1 likes to log a lot of actions. That is usually useful information and not a problem, but it can make for a larger database that&#8230; <a href=\"https:\/\/www.evermoretechnologies.com\/blog\/2017\/10\/clearing-magento-1-log-tables\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22,23],"tags":[],"_links":{"self":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/266"}],"collection":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=266"}],"version-history":[{"count":1,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":267,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/266\/revisions\/267"}],"wp:attachment":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}