How To Reset Test Orders And Dashboard Statistics in Magento 2How to add Custom fields to sales_flat_order in...

How do you make a gun that shoots melee weapons and/or swords?

Can a space-faring robot still function over a billion years?

Is there a math expression equivalent to the conditional ternary operator?

“I had a flat in the centre of town, but I didn’t like living there, so …”

What's the difference between Compensation, Indemnity, and Reparations?

Why is my explanation wrong?

PTIJ: Aliyot for the deceased

How do we objectively assess if a dialogue sounds unnatural or cringy?

Was it really inappropriate to write a pull request for the company I interviewed with?

What is a term for a function that when called repeatedly, has the same effect as calling once?

Do natural melee weapons (from racial traits) trigger Improved Divine Smite?

Ignoring Someone as Wrongful Speech

Can inspiration allow the Rogue to make a Sneak Attack?

Is it a Cyclops number? "Nobody" knows!

Why aren't there more gauls like Obelix?

School performs periodic password audits. Is my password compromised?

What's the best tool for cutting holes into duct work?

3.5% Interest Student Loan or use all of my savings on Tuition?

An Undercover Army

I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?

Professor forcing me to attend a conference

How to make sure I'm assertive enough in contact with subordinates?

Did Amazon pay $0 in taxes last year?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?



How To Reset Test Orders And Dashboard Statistics in Magento 2


How to add Custom fields to sales_flat_order in magentoWhat is the best way to delete a Magento order?Magento Dashboard QR Code instead of Graph! Google API Failure?Bundle products search/reset filter redirects to dashboardDisplay orders on client dashboard pageRecent orders are not appearing in the backend but exist in the database and are displayed in the dashboard1.9.2.1 CE - Refresh statistics not workingMoving customers and orders between CE and EEMagento 2 : How can I add customer dashboard navigation programaticallyHow to add signOut link in My Dashboard Page in Account Dashboard listed option programmatically magento 2













0















In Magento 1.x we can reset test orders and dashboard statistics by following link. In Magento 2.x may different names when we compare Magento 1.x and Magento 2.x tables.



Any one having solution? to reset test orders and dashboard statistics in Magento 2.










share|improve this question



























    0















    In Magento 1.x we can reset test orders and dashboard statistics by following link. In Magento 2.x may different names when we compare Magento 1.x and Magento 2.x tables.



    Any one having solution? to reset test orders and dashboard statistics in Magento 2.










    share|improve this question

























      0












      0








      0


      0






      In Magento 1.x we can reset test orders and dashboard statistics by following link. In Magento 2.x may different names when we compare Magento 1.x and Magento 2.x tables.



      Any one having solution? to reset test orders and dashboard statistics in Magento 2.










      share|improve this question














      In Magento 1.x we can reset test orders and dashboard statistics by following link. In Magento 2.x may different names when we compare Magento 1.x and Magento 2.x tables.



      Any one having solution? to reset test orders and dashboard statistics in Magento 2.







      magento2 orders dashboard statistics






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 2 '17 at 9:42









      BojjaiahBojjaiah

      2,4902572




      2,4902572






















          2 Answers
          2






          active

          oldest

          votes


















          2














          SET FOREIGN_KEY_CHECKS=0;

          # Clean order history
          TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
          TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
          TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

          # Clean order infos
          TRUNCATE TABLE `sales_creditmemo`;
          TRUNCATE TABLE `sales_creditmemo_comment`;
          TRUNCATE TABLE `sales_creditmemo_grid`;
          TRUNCATE TABLE `sales_creditmemo_item`;
          TRUNCATE TABLE `sales_invoice`;
          TRUNCATE TABLE `sales_invoiced_aggregated`;
          TRUNCATE TABLE `sales_invoiced_aggregated_order`;
          TRUNCATE TABLE `sales_invoice_comment`;
          TRUNCATE TABLE `sales_invoice_grid`;
          TRUNCATE TABLE `sales_invoice_item`;
          TRUNCATE TABLE `sales_order`;
          TRUNCATE TABLE `sales_order_address`;
          TRUNCATE TABLE `sales_order_aggregated_created`;
          TRUNCATE TABLE `sales_order_aggregated_updated`;
          TRUNCATE TABLE `sales_order_grid`;
          TRUNCATE TABLE `sales_order_item`;
          TRUNCATE TABLE `sales_order_payment`;
          TRUNCATE TABLE `sales_order_status_history`;
          TRUNCATE TABLE `sales_order_tax`;
          TRUNCATE TABLE `sales_order_tax_item`;
          TRUNCATE TABLE `sales_payment_transaction`;
          TRUNCATE TABLE `sales_refunded_aggregated`;
          TRUNCATE TABLE `sales_refunded_aggregated_order`;
          TRUNCATE TABLE `sales_shipment`;
          TRUNCATE TABLE `sales_shipment_comment`;
          TRUNCATE TABLE `sales_shipment_grid`;
          TRUNCATE TABLE `sales_shipment_item`;
          TRUNCATE TABLE `sales_shipment_track`;
          TRUNCATE TABLE `sales_shipping_aggregated`;
          TRUNCATE TABLE `sales_shipping_aggregated_order`;

          # Clean cart infos
          TRUNCATE TABLE `quote`;
          TRUNCATE TABLE `quote_address`;
          TRUNCATE TABLE `quote_address_item`;
          TRUNCATE TABLE `quote_id_mask`;
          TRUNCATE TABLE `quote_item`;
          TRUNCATE TABLE `quote_item_option`;
          TRUNCATE TABLE `quote_payment`;
          TRUNCATE TABLE `quote_shipping_rate`;

          # Reset indexes (if you want your orders number start back to 1
          TRUNCATE TABLE sequence_invoice_1;
          TRUNCATE TABLE sequence_order_1;
          TRUNCATE TABLE sequence_shipment_1;
          TRUNCATE TABLE sequence_creditmemo_1;


          SET FOREIGN_KEY_CHECKS=1;





          share|improve this answer
























          • its work for me after restart mysql

            – matinict
            Aug 27 '18 at 9:53



















          0














          Be safe : make a backup of your sql first.



          Please run below SQL query



          SET FOREIGN_KEY_CHECKS=0;

          # Clean order history
          TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
          TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
          TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

          # Clean order infos
          TRUNCATE TABLE `sales_creditmemo`;
          TRUNCATE TABLE `sales_creditmemo_comment`;
          TRUNCATE TABLE `sales_creditmemo_grid`;
          TRUNCATE TABLE `sales_creditmemo_item`;
          TRUNCATE TABLE `sales_invoice`;
          TRUNCATE TABLE `sales_invoiced_aggregated`;
          TRUNCATE TABLE `sales_invoiced_aggregated_order`;
          TRUNCATE TABLE `sales_invoice_comment`;
          TRUNCATE TABLE `sales_invoice_grid`;
          TRUNCATE TABLE `sales_invoice_item`;
          TRUNCATE TABLE `sales_order`;
          TRUNCATE TABLE `sales_order_address`;
          TRUNCATE TABLE `sales_order_aggregated_created`;
          TRUNCATE TABLE `sales_order_aggregated_updated`;
          TRUNCATE TABLE `sales_order_grid`;
          TRUNCATE TABLE `sales_order_item`;
          TRUNCATE TABLE `sales_order_payment`;
          TRUNCATE TABLE `sales_order_status_history`;
          TRUNCATE TABLE `sales_order_tax`;
          TRUNCATE TABLE `sales_order_tax_item`;
          TRUNCATE TABLE `sales_payment_transaction`;
          TRUNCATE TABLE `sales_refunded_aggregated`;
          TRUNCATE TABLE `sales_refunded_aggregated_order`;
          TRUNCATE TABLE `sales_shipment`;
          TRUNCATE TABLE `sales_shipment_comment`;
          TRUNCATE TABLE `sales_shipment_grid`;
          TRUNCATE TABLE `sales_shipment_item`;
          TRUNCATE TABLE `sales_shipment_track`;
          TRUNCATE TABLE `sales_shipping_aggregated`;
          TRUNCATE TABLE `sales_shipping_aggregated_order`;

          # Clean cart infos
          TRUNCATE TABLE `quote`;
          TRUNCATE TABLE `quote_address`;
          TRUNCATE TABLE `quote_address_item`;
          TRUNCATE TABLE `quote_id_mask`;
          TRUNCATE TABLE `quote_item`;
          TRUNCATE TABLE `quote_item_option`;
          TRUNCATE TABLE `quote_payment`;
          TRUNCATE TABLE `quote_shipping_rate`;

          # Reset indexes (if you want your orders number start back to 1
          TRUNCATE TABLE sequence_invoice_1;
          TRUNCATE TABLE sequence_order_1;
          TRUNCATE TABLE sequence_shipment_1;
          TRUNCATE TABLE sequence_creditmemo_1;


          SET FOREIGN_KEY_CHECKS=1;




          share























            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f187502%2fhow-to-reset-test-orders-and-dashboard-statistics-in-magento-2%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            SET FOREIGN_KEY_CHECKS=0;

            # Clean order history
            TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

            # Clean order infos
            TRUNCATE TABLE `sales_creditmemo`;
            TRUNCATE TABLE `sales_creditmemo_comment`;
            TRUNCATE TABLE `sales_creditmemo_grid`;
            TRUNCATE TABLE `sales_creditmemo_item`;
            TRUNCATE TABLE `sales_invoice`;
            TRUNCATE TABLE `sales_invoiced_aggregated`;
            TRUNCATE TABLE `sales_invoiced_aggregated_order`;
            TRUNCATE TABLE `sales_invoice_comment`;
            TRUNCATE TABLE `sales_invoice_grid`;
            TRUNCATE TABLE `sales_invoice_item`;
            TRUNCATE TABLE `sales_order`;
            TRUNCATE TABLE `sales_order_address`;
            TRUNCATE TABLE `sales_order_aggregated_created`;
            TRUNCATE TABLE `sales_order_aggregated_updated`;
            TRUNCATE TABLE `sales_order_grid`;
            TRUNCATE TABLE `sales_order_item`;
            TRUNCATE TABLE `sales_order_payment`;
            TRUNCATE TABLE `sales_order_status_history`;
            TRUNCATE TABLE `sales_order_tax`;
            TRUNCATE TABLE `sales_order_tax_item`;
            TRUNCATE TABLE `sales_payment_transaction`;
            TRUNCATE TABLE `sales_refunded_aggregated`;
            TRUNCATE TABLE `sales_refunded_aggregated_order`;
            TRUNCATE TABLE `sales_shipment`;
            TRUNCATE TABLE `sales_shipment_comment`;
            TRUNCATE TABLE `sales_shipment_grid`;
            TRUNCATE TABLE `sales_shipment_item`;
            TRUNCATE TABLE `sales_shipment_track`;
            TRUNCATE TABLE `sales_shipping_aggregated`;
            TRUNCATE TABLE `sales_shipping_aggregated_order`;

            # Clean cart infos
            TRUNCATE TABLE `quote`;
            TRUNCATE TABLE `quote_address`;
            TRUNCATE TABLE `quote_address_item`;
            TRUNCATE TABLE `quote_id_mask`;
            TRUNCATE TABLE `quote_item`;
            TRUNCATE TABLE `quote_item_option`;
            TRUNCATE TABLE `quote_payment`;
            TRUNCATE TABLE `quote_shipping_rate`;

            # Reset indexes (if you want your orders number start back to 1
            TRUNCATE TABLE sequence_invoice_1;
            TRUNCATE TABLE sequence_order_1;
            TRUNCATE TABLE sequence_shipment_1;
            TRUNCATE TABLE sequence_creditmemo_1;


            SET FOREIGN_KEY_CHECKS=1;





            share|improve this answer
























            • its work for me after restart mysql

              – matinict
              Aug 27 '18 at 9:53
















            2














            SET FOREIGN_KEY_CHECKS=0;

            # Clean order history
            TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

            # Clean order infos
            TRUNCATE TABLE `sales_creditmemo`;
            TRUNCATE TABLE `sales_creditmemo_comment`;
            TRUNCATE TABLE `sales_creditmemo_grid`;
            TRUNCATE TABLE `sales_creditmemo_item`;
            TRUNCATE TABLE `sales_invoice`;
            TRUNCATE TABLE `sales_invoiced_aggregated`;
            TRUNCATE TABLE `sales_invoiced_aggregated_order`;
            TRUNCATE TABLE `sales_invoice_comment`;
            TRUNCATE TABLE `sales_invoice_grid`;
            TRUNCATE TABLE `sales_invoice_item`;
            TRUNCATE TABLE `sales_order`;
            TRUNCATE TABLE `sales_order_address`;
            TRUNCATE TABLE `sales_order_aggregated_created`;
            TRUNCATE TABLE `sales_order_aggregated_updated`;
            TRUNCATE TABLE `sales_order_grid`;
            TRUNCATE TABLE `sales_order_item`;
            TRUNCATE TABLE `sales_order_payment`;
            TRUNCATE TABLE `sales_order_status_history`;
            TRUNCATE TABLE `sales_order_tax`;
            TRUNCATE TABLE `sales_order_tax_item`;
            TRUNCATE TABLE `sales_payment_transaction`;
            TRUNCATE TABLE `sales_refunded_aggregated`;
            TRUNCATE TABLE `sales_refunded_aggregated_order`;
            TRUNCATE TABLE `sales_shipment`;
            TRUNCATE TABLE `sales_shipment_comment`;
            TRUNCATE TABLE `sales_shipment_grid`;
            TRUNCATE TABLE `sales_shipment_item`;
            TRUNCATE TABLE `sales_shipment_track`;
            TRUNCATE TABLE `sales_shipping_aggregated`;
            TRUNCATE TABLE `sales_shipping_aggregated_order`;

            # Clean cart infos
            TRUNCATE TABLE `quote`;
            TRUNCATE TABLE `quote_address`;
            TRUNCATE TABLE `quote_address_item`;
            TRUNCATE TABLE `quote_id_mask`;
            TRUNCATE TABLE `quote_item`;
            TRUNCATE TABLE `quote_item_option`;
            TRUNCATE TABLE `quote_payment`;
            TRUNCATE TABLE `quote_shipping_rate`;

            # Reset indexes (if you want your orders number start back to 1
            TRUNCATE TABLE sequence_invoice_1;
            TRUNCATE TABLE sequence_order_1;
            TRUNCATE TABLE sequence_shipment_1;
            TRUNCATE TABLE sequence_creditmemo_1;


            SET FOREIGN_KEY_CHECKS=1;





            share|improve this answer
























            • its work for me after restart mysql

              – matinict
              Aug 27 '18 at 9:53














            2












            2








            2







            SET FOREIGN_KEY_CHECKS=0;

            # Clean order history
            TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

            # Clean order infos
            TRUNCATE TABLE `sales_creditmemo`;
            TRUNCATE TABLE `sales_creditmemo_comment`;
            TRUNCATE TABLE `sales_creditmemo_grid`;
            TRUNCATE TABLE `sales_creditmemo_item`;
            TRUNCATE TABLE `sales_invoice`;
            TRUNCATE TABLE `sales_invoiced_aggregated`;
            TRUNCATE TABLE `sales_invoiced_aggregated_order`;
            TRUNCATE TABLE `sales_invoice_comment`;
            TRUNCATE TABLE `sales_invoice_grid`;
            TRUNCATE TABLE `sales_invoice_item`;
            TRUNCATE TABLE `sales_order`;
            TRUNCATE TABLE `sales_order_address`;
            TRUNCATE TABLE `sales_order_aggregated_created`;
            TRUNCATE TABLE `sales_order_aggregated_updated`;
            TRUNCATE TABLE `sales_order_grid`;
            TRUNCATE TABLE `sales_order_item`;
            TRUNCATE TABLE `sales_order_payment`;
            TRUNCATE TABLE `sales_order_status_history`;
            TRUNCATE TABLE `sales_order_tax`;
            TRUNCATE TABLE `sales_order_tax_item`;
            TRUNCATE TABLE `sales_payment_transaction`;
            TRUNCATE TABLE `sales_refunded_aggregated`;
            TRUNCATE TABLE `sales_refunded_aggregated_order`;
            TRUNCATE TABLE `sales_shipment`;
            TRUNCATE TABLE `sales_shipment_comment`;
            TRUNCATE TABLE `sales_shipment_grid`;
            TRUNCATE TABLE `sales_shipment_item`;
            TRUNCATE TABLE `sales_shipment_track`;
            TRUNCATE TABLE `sales_shipping_aggregated`;
            TRUNCATE TABLE `sales_shipping_aggregated_order`;

            # Clean cart infos
            TRUNCATE TABLE `quote`;
            TRUNCATE TABLE `quote_address`;
            TRUNCATE TABLE `quote_address_item`;
            TRUNCATE TABLE `quote_id_mask`;
            TRUNCATE TABLE `quote_item`;
            TRUNCATE TABLE `quote_item_option`;
            TRUNCATE TABLE `quote_payment`;
            TRUNCATE TABLE `quote_shipping_rate`;

            # Reset indexes (if you want your orders number start back to 1
            TRUNCATE TABLE sequence_invoice_1;
            TRUNCATE TABLE sequence_order_1;
            TRUNCATE TABLE sequence_shipment_1;
            TRUNCATE TABLE sequence_creditmemo_1;


            SET FOREIGN_KEY_CHECKS=1;





            share|improve this answer













            SET FOREIGN_KEY_CHECKS=0;

            # Clean order history
            TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

            # Clean order infos
            TRUNCATE TABLE `sales_creditmemo`;
            TRUNCATE TABLE `sales_creditmemo_comment`;
            TRUNCATE TABLE `sales_creditmemo_grid`;
            TRUNCATE TABLE `sales_creditmemo_item`;
            TRUNCATE TABLE `sales_invoice`;
            TRUNCATE TABLE `sales_invoiced_aggregated`;
            TRUNCATE TABLE `sales_invoiced_aggregated_order`;
            TRUNCATE TABLE `sales_invoice_comment`;
            TRUNCATE TABLE `sales_invoice_grid`;
            TRUNCATE TABLE `sales_invoice_item`;
            TRUNCATE TABLE `sales_order`;
            TRUNCATE TABLE `sales_order_address`;
            TRUNCATE TABLE `sales_order_aggregated_created`;
            TRUNCATE TABLE `sales_order_aggregated_updated`;
            TRUNCATE TABLE `sales_order_grid`;
            TRUNCATE TABLE `sales_order_item`;
            TRUNCATE TABLE `sales_order_payment`;
            TRUNCATE TABLE `sales_order_status_history`;
            TRUNCATE TABLE `sales_order_tax`;
            TRUNCATE TABLE `sales_order_tax_item`;
            TRUNCATE TABLE `sales_payment_transaction`;
            TRUNCATE TABLE `sales_refunded_aggregated`;
            TRUNCATE TABLE `sales_refunded_aggregated_order`;
            TRUNCATE TABLE `sales_shipment`;
            TRUNCATE TABLE `sales_shipment_comment`;
            TRUNCATE TABLE `sales_shipment_grid`;
            TRUNCATE TABLE `sales_shipment_item`;
            TRUNCATE TABLE `sales_shipment_track`;
            TRUNCATE TABLE `sales_shipping_aggregated`;
            TRUNCATE TABLE `sales_shipping_aggregated_order`;

            # Clean cart infos
            TRUNCATE TABLE `quote`;
            TRUNCATE TABLE `quote_address`;
            TRUNCATE TABLE `quote_address_item`;
            TRUNCATE TABLE `quote_id_mask`;
            TRUNCATE TABLE `quote_item`;
            TRUNCATE TABLE `quote_item_option`;
            TRUNCATE TABLE `quote_payment`;
            TRUNCATE TABLE `quote_shipping_rate`;

            # Reset indexes (if you want your orders number start back to 1
            TRUNCATE TABLE sequence_invoice_1;
            TRUNCATE TABLE sequence_order_1;
            TRUNCATE TABLE sequence_shipment_1;
            TRUNCATE TABLE sequence_creditmemo_1;


            SET FOREIGN_KEY_CHECKS=1;






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 6 '17 at 18:15









            Sohaib KhanSohaib Khan

            307318




            307318













            • its work for me after restart mysql

              – matinict
              Aug 27 '18 at 9:53



















            • its work for me after restart mysql

              – matinict
              Aug 27 '18 at 9:53

















            its work for me after restart mysql

            – matinict
            Aug 27 '18 at 9:53





            its work for me after restart mysql

            – matinict
            Aug 27 '18 at 9:53













            0














            Be safe : make a backup of your sql first.



            Please run below SQL query



            SET FOREIGN_KEY_CHECKS=0;

            # Clean order history
            TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
            TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

            # Clean order infos
            TRUNCATE TABLE `sales_creditmemo`;
            TRUNCATE TABLE `sales_creditmemo_comment`;
            TRUNCATE TABLE `sales_creditmemo_grid`;
            TRUNCATE TABLE `sales_creditmemo_item`;
            TRUNCATE TABLE `sales_invoice`;
            TRUNCATE TABLE `sales_invoiced_aggregated`;
            TRUNCATE TABLE `sales_invoiced_aggregated_order`;
            TRUNCATE TABLE `sales_invoice_comment`;
            TRUNCATE TABLE `sales_invoice_grid`;
            TRUNCATE TABLE `sales_invoice_item`;
            TRUNCATE TABLE `sales_order`;
            TRUNCATE TABLE `sales_order_address`;
            TRUNCATE TABLE `sales_order_aggregated_created`;
            TRUNCATE TABLE `sales_order_aggregated_updated`;
            TRUNCATE TABLE `sales_order_grid`;
            TRUNCATE TABLE `sales_order_item`;
            TRUNCATE TABLE `sales_order_payment`;
            TRUNCATE TABLE `sales_order_status_history`;
            TRUNCATE TABLE `sales_order_tax`;
            TRUNCATE TABLE `sales_order_tax_item`;
            TRUNCATE TABLE `sales_payment_transaction`;
            TRUNCATE TABLE `sales_refunded_aggregated`;
            TRUNCATE TABLE `sales_refunded_aggregated_order`;
            TRUNCATE TABLE `sales_shipment`;
            TRUNCATE TABLE `sales_shipment_comment`;
            TRUNCATE TABLE `sales_shipment_grid`;
            TRUNCATE TABLE `sales_shipment_item`;
            TRUNCATE TABLE `sales_shipment_track`;
            TRUNCATE TABLE `sales_shipping_aggregated`;
            TRUNCATE TABLE `sales_shipping_aggregated_order`;

            # Clean cart infos
            TRUNCATE TABLE `quote`;
            TRUNCATE TABLE `quote_address`;
            TRUNCATE TABLE `quote_address_item`;
            TRUNCATE TABLE `quote_id_mask`;
            TRUNCATE TABLE `quote_item`;
            TRUNCATE TABLE `quote_item_option`;
            TRUNCATE TABLE `quote_payment`;
            TRUNCATE TABLE `quote_shipping_rate`;

            # Reset indexes (if you want your orders number start back to 1
            TRUNCATE TABLE sequence_invoice_1;
            TRUNCATE TABLE sequence_order_1;
            TRUNCATE TABLE sequence_shipment_1;
            TRUNCATE TABLE sequence_creditmemo_1;


            SET FOREIGN_KEY_CHECKS=1;




            share




























              0














              Be safe : make a backup of your sql first.



              Please run below SQL query



              SET FOREIGN_KEY_CHECKS=0;

              # Clean order history
              TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
              TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
              TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

              # Clean order infos
              TRUNCATE TABLE `sales_creditmemo`;
              TRUNCATE TABLE `sales_creditmemo_comment`;
              TRUNCATE TABLE `sales_creditmemo_grid`;
              TRUNCATE TABLE `sales_creditmemo_item`;
              TRUNCATE TABLE `sales_invoice`;
              TRUNCATE TABLE `sales_invoiced_aggregated`;
              TRUNCATE TABLE `sales_invoiced_aggregated_order`;
              TRUNCATE TABLE `sales_invoice_comment`;
              TRUNCATE TABLE `sales_invoice_grid`;
              TRUNCATE TABLE `sales_invoice_item`;
              TRUNCATE TABLE `sales_order`;
              TRUNCATE TABLE `sales_order_address`;
              TRUNCATE TABLE `sales_order_aggregated_created`;
              TRUNCATE TABLE `sales_order_aggregated_updated`;
              TRUNCATE TABLE `sales_order_grid`;
              TRUNCATE TABLE `sales_order_item`;
              TRUNCATE TABLE `sales_order_payment`;
              TRUNCATE TABLE `sales_order_status_history`;
              TRUNCATE TABLE `sales_order_tax`;
              TRUNCATE TABLE `sales_order_tax_item`;
              TRUNCATE TABLE `sales_payment_transaction`;
              TRUNCATE TABLE `sales_refunded_aggregated`;
              TRUNCATE TABLE `sales_refunded_aggregated_order`;
              TRUNCATE TABLE `sales_shipment`;
              TRUNCATE TABLE `sales_shipment_comment`;
              TRUNCATE TABLE `sales_shipment_grid`;
              TRUNCATE TABLE `sales_shipment_item`;
              TRUNCATE TABLE `sales_shipment_track`;
              TRUNCATE TABLE `sales_shipping_aggregated`;
              TRUNCATE TABLE `sales_shipping_aggregated_order`;

              # Clean cart infos
              TRUNCATE TABLE `quote`;
              TRUNCATE TABLE `quote_address`;
              TRUNCATE TABLE `quote_address_item`;
              TRUNCATE TABLE `quote_id_mask`;
              TRUNCATE TABLE `quote_item`;
              TRUNCATE TABLE `quote_item_option`;
              TRUNCATE TABLE `quote_payment`;
              TRUNCATE TABLE `quote_shipping_rate`;

              # Reset indexes (if you want your orders number start back to 1
              TRUNCATE TABLE sequence_invoice_1;
              TRUNCATE TABLE sequence_order_1;
              TRUNCATE TABLE sequence_shipment_1;
              TRUNCATE TABLE sequence_creditmemo_1;


              SET FOREIGN_KEY_CHECKS=1;




              share


























                0












                0








                0







                Be safe : make a backup of your sql first.



                Please run below SQL query



                SET FOREIGN_KEY_CHECKS=0;

                # Clean order history
                TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
                TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
                TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

                # Clean order infos
                TRUNCATE TABLE `sales_creditmemo`;
                TRUNCATE TABLE `sales_creditmemo_comment`;
                TRUNCATE TABLE `sales_creditmemo_grid`;
                TRUNCATE TABLE `sales_creditmemo_item`;
                TRUNCATE TABLE `sales_invoice`;
                TRUNCATE TABLE `sales_invoiced_aggregated`;
                TRUNCATE TABLE `sales_invoiced_aggregated_order`;
                TRUNCATE TABLE `sales_invoice_comment`;
                TRUNCATE TABLE `sales_invoice_grid`;
                TRUNCATE TABLE `sales_invoice_item`;
                TRUNCATE TABLE `sales_order`;
                TRUNCATE TABLE `sales_order_address`;
                TRUNCATE TABLE `sales_order_aggregated_created`;
                TRUNCATE TABLE `sales_order_aggregated_updated`;
                TRUNCATE TABLE `sales_order_grid`;
                TRUNCATE TABLE `sales_order_item`;
                TRUNCATE TABLE `sales_order_payment`;
                TRUNCATE TABLE `sales_order_status_history`;
                TRUNCATE TABLE `sales_order_tax`;
                TRUNCATE TABLE `sales_order_tax_item`;
                TRUNCATE TABLE `sales_payment_transaction`;
                TRUNCATE TABLE `sales_refunded_aggregated`;
                TRUNCATE TABLE `sales_refunded_aggregated_order`;
                TRUNCATE TABLE `sales_shipment`;
                TRUNCATE TABLE `sales_shipment_comment`;
                TRUNCATE TABLE `sales_shipment_grid`;
                TRUNCATE TABLE `sales_shipment_item`;
                TRUNCATE TABLE `sales_shipment_track`;
                TRUNCATE TABLE `sales_shipping_aggregated`;
                TRUNCATE TABLE `sales_shipping_aggregated_order`;

                # Clean cart infos
                TRUNCATE TABLE `quote`;
                TRUNCATE TABLE `quote_address`;
                TRUNCATE TABLE `quote_address_item`;
                TRUNCATE TABLE `quote_id_mask`;
                TRUNCATE TABLE `quote_item`;
                TRUNCATE TABLE `quote_item_option`;
                TRUNCATE TABLE `quote_payment`;
                TRUNCATE TABLE `quote_shipping_rate`;

                # Reset indexes (if you want your orders number start back to 1
                TRUNCATE TABLE sequence_invoice_1;
                TRUNCATE TABLE sequence_order_1;
                TRUNCATE TABLE sequence_shipment_1;
                TRUNCATE TABLE sequence_creditmemo_1;


                SET FOREIGN_KEY_CHECKS=1;




                share













                Be safe : make a backup of your sql first.



                Please run below SQL query



                SET FOREIGN_KEY_CHECKS=0;

                # Clean order history
                TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
                TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
                TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

                # Clean order infos
                TRUNCATE TABLE `sales_creditmemo`;
                TRUNCATE TABLE `sales_creditmemo_comment`;
                TRUNCATE TABLE `sales_creditmemo_grid`;
                TRUNCATE TABLE `sales_creditmemo_item`;
                TRUNCATE TABLE `sales_invoice`;
                TRUNCATE TABLE `sales_invoiced_aggregated`;
                TRUNCATE TABLE `sales_invoiced_aggregated_order`;
                TRUNCATE TABLE `sales_invoice_comment`;
                TRUNCATE TABLE `sales_invoice_grid`;
                TRUNCATE TABLE `sales_invoice_item`;
                TRUNCATE TABLE `sales_order`;
                TRUNCATE TABLE `sales_order_address`;
                TRUNCATE TABLE `sales_order_aggregated_created`;
                TRUNCATE TABLE `sales_order_aggregated_updated`;
                TRUNCATE TABLE `sales_order_grid`;
                TRUNCATE TABLE `sales_order_item`;
                TRUNCATE TABLE `sales_order_payment`;
                TRUNCATE TABLE `sales_order_status_history`;
                TRUNCATE TABLE `sales_order_tax`;
                TRUNCATE TABLE `sales_order_tax_item`;
                TRUNCATE TABLE `sales_payment_transaction`;
                TRUNCATE TABLE `sales_refunded_aggregated`;
                TRUNCATE TABLE `sales_refunded_aggregated_order`;
                TRUNCATE TABLE `sales_shipment`;
                TRUNCATE TABLE `sales_shipment_comment`;
                TRUNCATE TABLE `sales_shipment_grid`;
                TRUNCATE TABLE `sales_shipment_item`;
                TRUNCATE TABLE `sales_shipment_track`;
                TRUNCATE TABLE `sales_shipping_aggregated`;
                TRUNCATE TABLE `sales_shipping_aggregated_order`;

                # Clean cart infos
                TRUNCATE TABLE `quote`;
                TRUNCATE TABLE `quote_address`;
                TRUNCATE TABLE `quote_address_item`;
                TRUNCATE TABLE `quote_id_mask`;
                TRUNCATE TABLE `quote_item`;
                TRUNCATE TABLE `quote_item_option`;
                TRUNCATE TABLE `quote_payment`;
                TRUNCATE TABLE `quote_shipping_rate`;

                # Reset indexes (if you want your orders number start back to 1
                TRUNCATE TABLE sequence_invoice_1;
                TRUNCATE TABLE sequence_order_1;
                TRUNCATE TABLE sequence_shipment_1;
                TRUNCATE TABLE sequence_creditmemo_1;


                SET FOREIGN_KEY_CHECKS=1;





                share











                share


                share










                answered 2 mins ago









                gelanivishalgelanivishal

                787620




                787620






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f187502%2fhow-to-reset-test-orders-and-dashboard-statistics-in-magento-2%23new-answer', 'question_page');
                    }
                    );

                    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







                    Popular posts from this blog

                    “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                    How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                    夢乃愛華...