Magento2 - Remove Sample Data using Mysql ScriptInstall Sample Data on Enterprise 1.14How to delete all sample data magento 1.9Can't download sample data from ssh anymoreMagento 2 - sample data clean up scriptRemove Sample Data on M2.1CLI Sample Data installation error - Magento 2Sample data for community edition 1.8Magento 2: Error After Installing Sample Data using ComposerHow to get 10K products sample data in Magento 2?Magento 2: How to remove Category using category id by Mysql script
Sword in the Stone story where the sword was held in place by electromagnets
Touchscreen-controlled dentist office snowman collector game
What wound would be of little consequence to a biped but terrible for a quadruped?
Does splitting a potentially monolithic application into several smaller ones help prevent bugs?
Ban on all campaign finance?
Humans have energy, but not water. What happens?
Can infringement of a trademark be pursued for using a company's name in a sentence?
Why must traveling waves have the same amplitude to form a standing wave?
Can someone explain this Mudra being done by Ramakrishna Paramhansa in Samadhi?
US to Europe trip with Canada layover- is 52 minutes enough?
Is all copper pipe pretty much the same?
Do f-stop and exposure time perfectly cancel?
It's a yearly task, alright
Why don't MCU characters ever seem to have language issues?
Want to switch to tankless, but can I use my existing wiring?
How does Dispel Magic work against Stoneskin?
Is going from continuous data to categorical always wrong?
Is a lawful good "antagonist" effective?
"One can do his homework in the library"
Excess Zinc in garden soil
validation vs test vs training accuracy, which one to compare for claiming overfit?
What is the definition of "Natural Selection"?
Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?
How is the Swiss post e-voting system supposed to work, and how was it wrong?
Magento2 - Remove Sample Data using Mysql Script
Install Sample Data on Enterprise 1.14How to delete all sample data magento 1.9Can't download sample data from ssh anymoreMagento 2 - sample data clean up scriptRemove Sample Data on M2.1CLI Sample Data installation error - Magento 2Sample data for community edition 1.8Magento 2: Error After Installing Sample Data using ComposerHow to get 10K products sample data in Magento 2?Magento 2: How to remove Category using category id by Mysql script
Did anyone know how to remove the Sample data from Database using Mysql script, I know we can remove using CLI, But i need a script to remove in Database.
magento2 database sample-data
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Did anyone know how to remove the Sample data from Database using Mysql script, I know we can remove using CLI, But i need a script to remove in Database.
magento2 database sample-data
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Did anyone know how to remove the Sample data from Database using Mysql script, I know we can remove using CLI, But i need a script to remove in Database.
magento2 database sample-data
Did anyone know how to remove the Sample data from Database using Mysql script, I know we can remove using CLI, But i need a script to remove in Database.
magento2 database sample-data
magento2 database sample-data
asked Apr 12 '17 at 13:54
user2520
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This is what I have used to clean up test customers & orders:
-- Magento EE 2.1.1
SET FOREIGN_KEY_CHECKS = 0;
-- Clearing all orders
TRUNCATE sales_bestsellers_aggregated_daily;
TRUNCATE sales_bestsellers_aggregated_monthly;
TRUNCATE sales_bestsellers_aggregated_yearly;
TRUNCATE sales_creditmemo;
TRUNCATE sales_creditmemo_comment;
TRUNCATE sales_creditmemo_grid;
TRUNCATE sales_creditmemo_item;
TRUNCATE sales_invoice;
TRUNCATE sales_invoice_comment;
TRUNCATE sales_invoice_grid;
TRUNCATE sales_invoice_item;
TRUNCATE sales_invoiced_aggregated;
TRUNCATE sales_invoiced_aggregated_order;
TRUNCATE sales_order;
TRUNCATE sales_order_address;
TRUNCATE sales_order_aggregated_created;
TRUNCATE sales_order_aggregated_updated;
TRUNCATE sales_order_grid;
TRUNCATE sales_order_item;
TRUNCATE sales_order_payment;
-- TRUNCATE sales_order_status;
TRUNCATE sales_order_status_history;
-- TRUNCATE sales_order_status_label;
-- TRUNCATE sales_order_status_state;
TRUNCATE sales_order_tax;
TRUNCATE sales_order_tax_item;
TRUNCATE sales_payment_transaction;
TRUNCATE sales_refunded_aggregated;
TRUNCATE sales_refunded_aggregated_order;
-- TRUNCATE sales_sequence_meta;
-- TRUNCATE sales_sequence_profile;
TRUNCATE sales_shipment;
TRUNCATE sales_shipment_comment;
TRUNCATE sales_shipment_grid;
TRUNCATE sales_shipment_item;
TRUNCATE sales_shipment_track;
TRUNCATE sales_shipping_aggregated;
TRUNCATE sales_shipping_aggregated_order;
TRUNCATE tax_order_aggregated_created;
TRUNCATE tax_order_aggregated_updated;
TRUNCATE reporting_orders;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_order;
TRUNCATE magento_customercustomattributes_sales_flat_order_address;
TRUNCATE magento_sales_creditmemo_grid_archive;
TRUNCATE magento_sales_invoice_grid_archive;
TRUNCATE magento_sales_order_grid_archive;
TRUNCATE magento_sales_shipment_grid_archive;
-- Clearing all cart items
TRUNCATE quote;
TRUNCATE quote_address;
TRUNCATE quote_address_item;
TRUNCATE quote_id_mask;
TRUNCATE quote_item;
TRUNCATE quote_item_option;
TRUNCATE quote_payment;
TRUNCATE quote_shipping_rate;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_quote;
TRUNCATE magento_customercustomattributes_sales_flat_quote_address;
-- Clearing all customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
TRUNCATE customer_dummy_cl;
-- TRUNCATE customer_eav_attribute;
-- TRUNCATE customer_eav_attribute_website;
TRUNCATE customer_entity;
TRUNCATE customer_entity_datetime;
TRUNCATE customer_entity_decimal;
TRUNCATE customer_entity_int;
TRUNCATE customer_entity_text;
TRUNCATE customer_entity_varchar;
-- TRUNCATE customer_form_attribute;
TRUNCATE customer_grid_flat;
-- TRUNCATE customer_group;
TRUNCATE customer_log;
TRUNCATE customer_visitor;
TRUNCATE persistent_session;
TRUNCATE wishlist;
TRUNCATE wishlist_item;
TRUNCATE wishlist_item_option;
-- reviews (be careful...)
TRUNCATE gift_message;
TRUNCATE review;
TRUNCATE review_detail;
-- TRUNCATE review_entity;
TRUNCATE review_entity_summary;
-- TRUNCATE review_status;
TRUNCATE review_store;
-- Clearing log tables
TRUNCATE magento_logging_event;
TRUNCATE magento_logging_event_changes;
SET FOREIGN_KEY_CHECKS = 1;
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f169880%2fmagento2-remove-sample-data-using-mysql-script%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is what I have used to clean up test customers & orders:
-- Magento EE 2.1.1
SET FOREIGN_KEY_CHECKS = 0;
-- Clearing all orders
TRUNCATE sales_bestsellers_aggregated_daily;
TRUNCATE sales_bestsellers_aggregated_monthly;
TRUNCATE sales_bestsellers_aggregated_yearly;
TRUNCATE sales_creditmemo;
TRUNCATE sales_creditmemo_comment;
TRUNCATE sales_creditmemo_grid;
TRUNCATE sales_creditmemo_item;
TRUNCATE sales_invoice;
TRUNCATE sales_invoice_comment;
TRUNCATE sales_invoice_grid;
TRUNCATE sales_invoice_item;
TRUNCATE sales_invoiced_aggregated;
TRUNCATE sales_invoiced_aggregated_order;
TRUNCATE sales_order;
TRUNCATE sales_order_address;
TRUNCATE sales_order_aggregated_created;
TRUNCATE sales_order_aggregated_updated;
TRUNCATE sales_order_grid;
TRUNCATE sales_order_item;
TRUNCATE sales_order_payment;
-- TRUNCATE sales_order_status;
TRUNCATE sales_order_status_history;
-- TRUNCATE sales_order_status_label;
-- TRUNCATE sales_order_status_state;
TRUNCATE sales_order_tax;
TRUNCATE sales_order_tax_item;
TRUNCATE sales_payment_transaction;
TRUNCATE sales_refunded_aggregated;
TRUNCATE sales_refunded_aggregated_order;
-- TRUNCATE sales_sequence_meta;
-- TRUNCATE sales_sequence_profile;
TRUNCATE sales_shipment;
TRUNCATE sales_shipment_comment;
TRUNCATE sales_shipment_grid;
TRUNCATE sales_shipment_item;
TRUNCATE sales_shipment_track;
TRUNCATE sales_shipping_aggregated;
TRUNCATE sales_shipping_aggregated_order;
TRUNCATE tax_order_aggregated_created;
TRUNCATE tax_order_aggregated_updated;
TRUNCATE reporting_orders;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_order;
TRUNCATE magento_customercustomattributes_sales_flat_order_address;
TRUNCATE magento_sales_creditmemo_grid_archive;
TRUNCATE magento_sales_invoice_grid_archive;
TRUNCATE magento_sales_order_grid_archive;
TRUNCATE magento_sales_shipment_grid_archive;
-- Clearing all cart items
TRUNCATE quote;
TRUNCATE quote_address;
TRUNCATE quote_address_item;
TRUNCATE quote_id_mask;
TRUNCATE quote_item;
TRUNCATE quote_item_option;
TRUNCATE quote_payment;
TRUNCATE quote_shipping_rate;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_quote;
TRUNCATE magento_customercustomattributes_sales_flat_quote_address;
-- Clearing all customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
TRUNCATE customer_dummy_cl;
-- TRUNCATE customer_eav_attribute;
-- TRUNCATE customer_eav_attribute_website;
TRUNCATE customer_entity;
TRUNCATE customer_entity_datetime;
TRUNCATE customer_entity_decimal;
TRUNCATE customer_entity_int;
TRUNCATE customer_entity_text;
TRUNCATE customer_entity_varchar;
-- TRUNCATE customer_form_attribute;
TRUNCATE customer_grid_flat;
-- TRUNCATE customer_group;
TRUNCATE customer_log;
TRUNCATE customer_visitor;
TRUNCATE persistent_session;
TRUNCATE wishlist;
TRUNCATE wishlist_item;
TRUNCATE wishlist_item_option;
-- reviews (be careful...)
TRUNCATE gift_message;
TRUNCATE review;
TRUNCATE review_detail;
-- TRUNCATE review_entity;
TRUNCATE review_entity_summary;
-- TRUNCATE review_status;
TRUNCATE review_store;
-- Clearing log tables
TRUNCATE magento_logging_event;
TRUNCATE magento_logging_event_changes;
SET FOREIGN_KEY_CHECKS = 1;
add a comment |
This is what I have used to clean up test customers & orders:
-- Magento EE 2.1.1
SET FOREIGN_KEY_CHECKS = 0;
-- Clearing all orders
TRUNCATE sales_bestsellers_aggregated_daily;
TRUNCATE sales_bestsellers_aggregated_monthly;
TRUNCATE sales_bestsellers_aggregated_yearly;
TRUNCATE sales_creditmemo;
TRUNCATE sales_creditmemo_comment;
TRUNCATE sales_creditmemo_grid;
TRUNCATE sales_creditmemo_item;
TRUNCATE sales_invoice;
TRUNCATE sales_invoice_comment;
TRUNCATE sales_invoice_grid;
TRUNCATE sales_invoice_item;
TRUNCATE sales_invoiced_aggregated;
TRUNCATE sales_invoiced_aggregated_order;
TRUNCATE sales_order;
TRUNCATE sales_order_address;
TRUNCATE sales_order_aggregated_created;
TRUNCATE sales_order_aggregated_updated;
TRUNCATE sales_order_grid;
TRUNCATE sales_order_item;
TRUNCATE sales_order_payment;
-- TRUNCATE sales_order_status;
TRUNCATE sales_order_status_history;
-- TRUNCATE sales_order_status_label;
-- TRUNCATE sales_order_status_state;
TRUNCATE sales_order_tax;
TRUNCATE sales_order_tax_item;
TRUNCATE sales_payment_transaction;
TRUNCATE sales_refunded_aggregated;
TRUNCATE sales_refunded_aggregated_order;
-- TRUNCATE sales_sequence_meta;
-- TRUNCATE sales_sequence_profile;
TRUNCATE sales_shipment;
TRUNCATE sales_shipment_comment;
TRUNCATE sales_shipment_grid;
TRUNCATE sales_shipment_item;
TRUNCATE sales_shipment_track;
TRUNCATE sales_shipping_aggregated;
TRUNCATE sales_shipping_aggregated_order;
TRUNCATE tax_order_aggregated_created;
TRUNCATE tax_order_aggregated_updated;
TRUNCATE reporting_orders;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_order;
TRUNCATE magento_customercustomattributes_sales_flat_order_address;
TRUNCATE magento_sales_creditmemo_grid_archive;
TRUNCATE magento_sales_invoice_grid_archive;
TRUNCATE magento_sales_order_grid_archive;
TRUNCATE magento_sales_shipment_grid_archive;
-- Clearing all cart items
TRUNCATE quote;
TRUNCATE quote_address;
TRUNCATE quote_address_item;
TRUNCATE quote_id_mask;
TRUNCATE quote_item;
TRUNCATE quote_item_option;
TRUNCATE quote_payment;
TRUNCATE quote_shipping_rate;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_quote;
TRUNCATE magento_customercustomattributes_sales_flat_quote_address;
-- Clearing all customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
TRUNCATE customer_dummy_cl;
-- TRUNCATE customer_eav_attribute;
-- TRUNCATE customer_eav_attribute_website;
TRUNCATE customer_entity;
TRUNCATE customer_entity_datetime;
TRUNCATE customer_entity_decimal;
TRUNCATE customer_entity_int;
TRUNCATE customer_entity_text;
TRUNCATE customer_entity_varchar;
-- TRUNCATE customer_form_attribute;
TRUNCATE customer_grid_flat;
-- TRUNCATE customer_group;
TRUNCATE customer_log;
TRUNCATE customer_visitor;
TRUNCATE persistent_session;
TRUNCATE wishlist;
TRUNCATE wishlist_item;
TRUNCATE wishlist_item_option;
-- reviews (be careful...)
TRUNCATE gift_message;
TRUNCATE review;
TRUNCATE review_detail;
-- TRUNCATE review_entity;
TRUNCATE review_entity_summary;
-- TRUNCATE review_status;
TRUNCATE review_store;
-- Clearing log tables
TRUNCATE magento_logging_event;
TRUNCATE magento_logging_event_changes;
SET FOREIGN_KEY_CHECKS = 1;
add a comment |
This is what I have used to clean up test customers & orders:
-- Magento EE 2.1.1
SET FOREIGN_KEY_CHECKS = 0;
-- Clearing all orders
TRUNCATE sales_bestsellers_aggregated_daily;
TRUNCATE sales_bestsellers_aggregated_monthly;
TRUNCATE sales_bestsellers_aggregated_yearly;
TRUNCATE sales_creditmemo;
TRUNCATE sales_creditmemo_comment;
TRUNCATE sales_creditmemo_grid;
TRUNCATE sales_creditmemo_item;
TRUNCATE sales_invoice;
TRUNCATE sales_invoice_comment;
TRUNCATE sales_invoice_grid;
TRUNCATE sales_invoice_item;
TRUNCATE sales_invoiced_aggregated;
TRUNCATE sales_invoiced_aggregated_order;
TRUNCATE sales_order;
TRUNCATE sales_order_address;
TRUNCATE sales_order_aggregated_created;
TRUNCATE sales_order_aggregated_updated;
TRUNCATE sales_order_grid;
TRUNCATE sales_order_item;
TRUNCATE sales_order_payment;
-- TRUNCATE sales_order_status;
TRUNCATE sales_order_status_history;
-- TRUNCATE sales_order_status_label;
-- TRUNCATE sales_order_status_state;
TRUNCATE sales_order_tax;
TRUNCATE sales_order_tax_item;
TRUNCATE sales_payment_transaction;
TRUNCATE sales_refunded_aggregated;
TRUNCATE sales_refunded_aggregated_order;
-- TRUNCATE sales_sequence_meta;
-- TRUNCATE sales_sequence_profile;
TRUNCATE sales_shipment;
TRUNCATE sales_shipment_comment;
TRUNCATE sales_shipment_grid;
TRUNCATE sales_shipment_item;
TRUNCATE sales_shipment_track;
TRUNCATE sales_shipping_aggregated;
TRUNCATE sales_shipping_aggregated_order;
TRUNCATE tax_order_aggregated_created;
TRUNCATE tax_order_aggregated_updated;
TRUNCATE reporting_orders;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_order;
TRUNCATE magento_customercustomattributes_sales_flat_order_address;
TRUNCATE magento_sales_creditmemo_grid_archive;
TRUNCATE magento_sales_invoice_grid_archive;
TRUNCATE magento_sales_order_grid_archive;
TRUNCATE magento_sales_shipment_grid_archive;
-- Clearing all cart items
TRUNCATE quote;
TRUNCATE quote_address;
TRUNCATE quote_address_item;
TRUNCATE quote_id_mask;
TRUNCATE quote_item;
TRUNCATE quote_item_option;
TRUNCATE quote_payment;
TRUNCATE quote_shipping_rate;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_quote;
TRUNCATE magento_customercustomattributes_sales_flat_quote_address;
-- Clearing all customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
TRUNCATE customer_dummy_cl;
-- TRUNCATE customer_eav_attribute;
-- TRUNCATE customer_eav_attribute_website;
TRUNCATE customer_entity;
TRUNCATE customer_entity_datetime;
TRUNCATE customer_entity_decimal;
TRUNCATE customer_entity_int;
TRUNCATE customer_entity_text;
TRUNCATE customer_entity_varchar;
-- TRUNCATE customer_form_attribute;
TRUNCATE customer_grid_flat;
-- TRUNCATE customer_group;
TRUNCATE customer_log;
TRUNCATE customer_visitor;
TRUNCATE persistent_session;
TRUNCATE wishlist;
TRUNCATE wishlist_item;
TRUNCATE wishlist_item_option;
-- reviews (be careful...)
TRUNCATE gift_message;
TRUNCATE review;
TRUNCATE review_detail;
-- TRUNCATE review_entity;
TRUNCATE review_entity_summary;
-- TRUNCATE review_status;
TRUNCATE review_store;
-- Clearing log tables
TRUNCATE magento_logging_event;
TRUNCATE magento_logging_event_changes;
SET FOREIGN_KEY_CHECKS = 1;
This is what I have used to clean up test customers & orders:
-- Magento EE 2.1.1
SET FOREIGN_KEY_CHECKS = 0;
-- Clearing all orders
TRUNCATE sales_bestsellers_aggregated_daily;
TRUNCATE sales_bestsellers_aggregated_monthly;
TRUNCATE sales_bestsellers_aggregated_yearly;
TRUNCATE sales_creditmemo;
TRUNCATE sales_creditmemo_comment;
TRUNCATE sales_creditmemo_grid;
TRUNCATE sales_creditmemo_item;
TRUNCATE sales_invoice;
TRUNCATE sales_invoice_comment;
TRUNCATE sales_invoice_grid;
TRUNCATE sales_invoice_item;
TRUNCATE sales_invoiced_aggregated;
TRUNCATE sales_invoiced_aggregated_order;
TRUNCATE sales_order;
TRUNCATE sales_order_address;
TRUNCATE sales_order_aggregated_created;
TRUNCATE sales_order_aggregated_updated;
TRUNCATE sales_order_grid;
TRUNCATE sales_order_item;
TRUNCATE sales_order_payment;
-- TRUNCATE sales_order_status;
TRUNCATE sales_order_status_history;
-- TRUNCATE sales_order_status_label;
-- TRUNCATE sales_order_status_state;
TRUNCATE sales_order_tax;
TRUNCATE sales_order_tax_item;
TRUNCATE sales_payment_transaction;
TRUNCATE sales_refunded_aggregated;
TRUNCATE sales_refunded_aggregated_order;
-- TRUNCATE sales_sequence_meta;
-- TRUNCATE sales_sequence_profile;
TRUNCATE sales_shipment;
TRUNCATE sales_shipment_comment;
TRUNCATE sales_shipment_grid;
TRUNCATE sales_shipment_item;
TRUNCATE sales_shipment_track;
TRUNCATE sales_shipping_aggregated;
TRUNCATE sales_shipping_aggregated_order;
TRUNCATE tax_order_aggregated_created;
TRUNCATE tax_order_aggregated_updated;
TRUNCATE reporting_orders;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_order;
TRUNCATE magento_customercustomattributes_sales_flat_order_address;
TRUNCATE magento_sales_creditmemo_grid_archive;
TRUNCATE magento_sales_invoice_grid_archive;
TRUNCATE magento_sales_order_grid_archive;
TRUNCATE magento_sales_shipment_grid_archive;
-- Clearing all cart items
TRUNCATE quote;
TRUNCATE quote_address;
TRUNCATE quote_address_item;
TRUNCATE quote_id_mask;
TRUNCATE quote_item;
TRUNCATE quote_item_option;
TRUNCATE quote_payment;
TRUNCATE quote_shipping_rate;
-- EE Only
TRUNCATE magento_customercustomattributes_sales_flat_quote;
TRUNCATE magento_customercustomattributes_sales_flat_quote_address;
-- Clearing all customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
TRUNCATE customer_dummy_cl;
-- TRUNCATE customer_eav_attribute;
-- TRUNCATE customer_eav_attribute_website;
TRUNCATE customer_entity;
TRUNCATE customer_entity_datetime;
TRUNCATE customer_entity_decimal;
TRUNCATE customer_entity_int;
TRUNCATE customer_entity_text;
TRUNCATE customer_entity_varchar;
-- TRUNCATE customer_form_attribute;
TRUNCATE customer_grid_flat;
-- TRUNCATE customer_group;
TRUNCATE customer_log;
TRUNCATE customer_visitor;
TRUNCATE persistent_session;
TRUNCATE wishlist;
TRUNCATE wishlist_item;
TRUNCATE wishlist_item_option;
-- reviews (be careful...)
TRUNCATE gift_message;
TRUNCATE review;
TRUNCATE review_detail;
-- TRUNCATE review_entity;
TRUNCATE review_entity_summary;
-- TRUNCATE review_status;
TRUNCATE review_store;
-- Clearing log tables
TRUNCATE magento_logging_event;
TRUNCATE magento_logging_event_changes;
SET FOREIGN_KEY_CHECKS = 1;
answered Apr 12 '17 at 14:13
MagePsychoMagePsycho
3,21211944
3,21211944
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f169880%2fmagento2-remove-sample-data-using-mysql-script%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown