Skip to content

Instantly share code, notes, and snippets.

@mystix
Last active May 3, 2022 22:16
Show Gist options
  • Save mystix/5360885 to your computer and use it in GitHub Desktop.
Save mystix/5360885 to your computer and use it in GitHub Desktop.
Magento: reset dashboard data
SET foreign_key_checks = 0;
-- Last 5 Search Terms / Top 5 Search Terms
TRUNCATE TABLE catalogsearch_fulltext;
TRUNCATE TABLE catalogsearch_query;
TRUNCATE TABLE catalogsearch_result;
-- Dashboard stats (e.g. "Most Viewed Products" etc)
TRUNCATE TABLE report_compared_product_index;
TRUNCATE TABLE report_event;
TRUNCATE TABLE report_viewed_product_aggregated_daily;
TRUNCATE TABLE report_viewed_product_aggregated_monthly;
TRUNCATE TABLE report_viewed_product_aggregated_yearly;
TRUNCATE TABLE report_viewed_product_index;
-- Bestsellers
TRUNCATE TABLE sales_bestsellers_aggregated_daily;
TRUNCATE TABLE sales_bestsellers_aggregated_monthly;
TRUNCATE TABLE sales_bestsellers_aggregated_yearly;
SET foreign_key_checks = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment