Every successful Ecommerce store depends on sizable databases to sell products and services online. Magento is a robust Ecommerce system that uses database logs like any other website. And to speed up your ecommerce store, it is essential to clean up the logs on a regular basis and optimize the store for faster loading. You can gain a significant boost in performance by cleaning your logs and optimize Magento store database regularly. It also assists in reducing the latency of query execution.
Magento stores that pile up a few GB’s of logs slow down the performance of the store and increase the usage of the deployed resources. It is time for you to learn how you can clean them up. In this article, I am going to share an easy to use way of how to clean your Magento database.
Magento Optimize Database Log
Magento maintains few tables for logging purposes. These tables create logs, for example, logs for which products have been compared. Magento has a mechanism for cleaning these logs regularly. However, this feature is disabled by default and most customers don’t turn it on. There are three ways to clean out these tables:
- Log Cleaning in the Magento Admin,
- Through log.php in the ../shell directory, and
- Manually via phpMyAdmin or MySQL Manager.
These following tables are used and managed by Magento’s log cleaning functions:
Cleaning Logs via Magento Admin Panel
This method is straightforward and useful for non-technical store owners who do not want to work around directly with the Magento stores database. You can follow the following steps to clean database logs:
First Log in to your Magento Admin Panel.
- Go to System > Configuration.
- On the left side, under Advanced, click on System (Advanced > System).
- Under System, you see Log option.
- Under “Log Cleaning,” change “Enable Log Cleaning” to YES and configure the Save Log for 15 days (or select the time you need to clean your log)
- Click “Save Config.”
Cleaning Logs via MySQL Manager
If you are familiar with MySQL and queries, then this method is more useful and quicker than the default Magento log cleaning. This method also allows you to clean whatever log you like; you can even clean table which is not included in default Magento log cleaning. I will be using the Cloudways Platform to perform this.
- In the Cloudways platform, go to Applications and under ACCESS DETAILS, tap LAUNCH DATABASE MANAGER button.
In the right side of your MySQL manager, click on the below-mentioned boxes for the following tables:
- Select all of the listed tables above in MySQL manager and click Truncate Button, Shown in image below:
Keep in mind that you just need to Truncate selected tables without dropping them. Be very careful when doing this.
Note: Some statistic data will be lost if you clean these log tables (like guest information, visit URL data…etc), if you think they are useless for you, then don’t hesitate to clear. If you are not sure what to erase, then save a backup in case things do not go as planned.
You should be careful when using these methods of clearing your logs. It is better to first take a backup of your Magento based ecommerce store before making any changes. With Cloudways, you have the option of taking a backup with just a single click. The Cloudways Magento Hosting platform is optimized to host Magento store of all sizes. Sign up now and see the power of managed Magento hosting sail you pass this (and many other) holiday seasons to come! And did I mention, You get a FREE trial for 3 days!
Fayyaz is a Magento Community Manager at Cloudways - A Managed Magento Hosting Platform. His objective is to learn & share about PHP & Magento Development in Community. Fayyaz is a food lover and enjoys driving. You can email him at email@example.com
Start Growing with Cloudways Today.
Our Clients Love us because we never compromise on these