Skip to content

Instantly share code, notes, and snippets.

@DevertNet
Last active May 18, 2022 17:42
Show Gist options
  • Save DevertNet/8c29a16ccfc07dd6c790a8374eb6f2a3 to your computer and use it in GitHub Desktop.
Save DevertNet/8c29a16ccfc07dd6c790a8374eb6f2a3 to your computer and use it in GitHub Desktop.
Shopware Database Clean: Remove Customers and Orders.
#https://docs.shopware.com/de/shopware-5-de/tutorials-und-faq/sql-tipps-tricks
SET foreign_key_checks = 0;
TRUNCATE `s_user`;
TRUNCATE `s_user_addresses`;
TRUNCATE `s_user_addresses_attributes`;
TRUNCATE `s_user_attributes`;
TRUNCATE `s_user_billingaddress`;
TRUNCATE `s_user_billingaddress_attributes`;
TRUNCATE `s_user_shippingaddress`;
TRUNCATE `s_user_shippingaddress_attributes`;
TRUNCATE `s_order`;
TRUNCATE `s_order_attributes`;
TRUNCATE `s_order_basket`;
TRUNCATE `s_order_basket_attributes`;
TRUNCATE `s_order_billingaddress`;
TRUNCATE `s_order_billingaddress_attributes`;
TRUNCATE `s_order_comparisons`;
TRUNCATE `s_order_details`;
TRUNCATE `s_order_details_attributes`;
TRUNCATE `s_order_documents`;
TRUNCATE `s_order_documents_attributes`;
TRUNCATE `s_order_esd`;
TRUNCATE `s_order_history`;
TRUNCATE `s_order_notes`;
TRUNCATE `s_order_shippingaddress`;
TRUNCATE `s_order_shippingaddress_attributes`;
TRUNCATE `s_statistics_currentusers`;
TRUNCATE `s_statistics_pool`;
TRUNCATE `s_statistics_referer`;
TRUNCATE `s_statistics_search`;
TRUNCATE `s_statistics_visitors`;
TRUNCATE magnalister_amazon_prepare;
TRUNCATE magnalister_orders;
TRUNCATE s_emarketing_lastarticles;
TRUNCATE s_emarketing_referer;
TRUNCATE s_es_backlog;
TRUNCATE s_statistics_article_impression;
#TRUNCATE s_core_config_mails;
TRUNCATE s_core_payment_instance;
TRUNCATE s_customer_search_index;
TRUNCATE s_plugin_swag_fuzzy_statistics;
TRUNCATE s_search_index;
TRUNCATE s_core_log;
TRUNCATE s_import_export_log;
TRUNCATE s_import_export_session;
TRUNCATE saferpaycw_transaction;
TRUNCATE s_articles_similar_shown_ro;
SET foreign_key_checks = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment