FOL9000

Magento: Alle Bestellungen löschen

von | 130 Kommentare

Auf Testsystemen häufen sich schnell Bestellungen an, die irgendwann stören. Besonders das Übertragen der Datenbank auf andere Systeme ist dann zwar noch möglich, aber man hat den Test-Müll dann auch auf dem neuen System. Weil Magento keine Funktion hat, um Bestellungen zu löschen, hilft das folgende Script: Es versetzt die Datenbank wieder in einen vorzeigbaren und brauchbaren Zustand.

Das kurze SQL-Script löscht den beim Testen anfallenden Bestellungs-Müll. Alles, was beim Testen so anfällt, was man aber nicht auf andere Systeme übertragen möchte, wird komplett entfernt. Danach dürfte die Datenbank in einem sauberen Zustand sein, sodass man ein Datenbank-Export problemlos auf einem anderen System einsetzen kann.

Die Datenbankstruktur von Magento ist nicht gerade einfach und zwischen den Versionen auch manchmal leicht unterschiedlich. Ich habs unter 1.7.0.2 ausprobiert und es funktionierte problemlos. Trotzdem: Anwendung auf eigene Gefahr, und vorher ein Backup machen! (Kleines Update: Auch unter 1.9.0.1 funktioniert es.)

Das Script setzt nicht den Counter für die Bestell-Nummern zurück. Hat man zehn Bestellungen gelöscht bekommt trotz des Löschens die nächste Bestellung die Nummer elf. Dies lässt sich mit Anweisungen zum Setzen des Increment-Counters lösen, die ich ebendort beschrieben habe.

Vor dem Ausführen muss natürlich noch im USE-Statement der richtige Datenbank-Name eingesetzt werden.

Und noch etwas: Obwohl der folgende SQL-Code an Einfachheit kaum zu überbieten sein dürfte: Er ist nicht von mir, ich weiß aber auch nicht mehr, woher er ist.

-- Reset Magento Test Data
-- Checked with 1.7.0.2
USE `magento_databse`;
SET FOREIGN_KEY_CHECKS=0;
-- reset dashboard search queries
TRUNCATE `catalogsearch_query`;
ALTER TABLE `catalogsearch_query` AUTO_INCREMENT=1;
-- reset sales order info
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `sales_order_aggregated_created`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
SET FOREIGN_KEY_CHECKS=1;

130 Kommentare

  1. betamethasone acetatena phos

  2. betamethasone acetatena phos

  3. betamethasone acetatena phos

  4. Really informative blog article.Really thank you! Want more.

  5. Really informative blog article.Really thank you! Want more.

  6. Really informative blog article.Really thank you! Want more.

  7. Some truly select blog posts on this web site , saved to fav.

  8. Some truly select blog posts on this web site , saved to fav.

  9. Some truly select blog posts on this web site , saved to fav.

  10. Howdy! Do you know if they make any plugins to protect against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?

  11. Howdy! Do you know if they make any plugins to protect against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?

  12. Very nice post. I certainly appreciate this website.

  13. Very nice post. I certainly appreciate this website.

  14. If some one wants expert view concerning running a blog afterward i advise himher to pay a quick visit this

  15. If some one wants expert view concerning running a blog afterward i advise himher to pay a quick visit this

  16. Ovver the course of the initial period, they began tto form grooup

  17. Ovver the course of the initial period, they began tto form grooup

  18. Ovver the course of the initial period, they began tto form grooup

  19. Thanks so much for the article.Much thanks again. Great.

  20. Thanks so much for the article.Much thanks again. Great.

  21. Thanks so much for the article.Much thanks again. Great.

  22. Wow, fantastic blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is wonderful, let alone the content!

  23. Wow, fantastic blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is wonderful, let alone the content!

  24. It’s a mammoth playground built of mountains, hills, lakes, rivers, valleys, woodlands,and beaches.

  25. It’s a mammoth playground built of mountains, hills, lakes, rivers, valleys, woodlands,and beaches.

  26. It’s a mammoth playground built of mountains, hills, lakes, rivers, valleys, woodlands,and beaches.

  27. I like this weblog so considerably, saved to my bookmarks.

  28. I like this weblog so considerably, saved to my bookmarks.

  29. you have a terrific blog here! would you like to make some invite posts on my weblog?

  30. you have a terrific blog here! would you like to make some invite posts on my weblog?

  31. you have a terrific blog here! would you like to make some invite posts on my weblog?

  32. I like the valuable info you provide in your articles. I will bookmark your blog and check again here regularly. I am quite certain I’ll learn a lot of new stuff right here! Best of luck for the next!

  33. I like the valuable info you provide in your articles. I will bookmark your blog and check again here regularly. I am quite certain I’ll learn a lot of new stuff right here! Best of luck for the next!

  34. I like the valuable info you provide in your articles. I will bookmark your blog and check again here regularly. I am quite certain I’ll learn a lot of new stuff right here! Best of luck for the next!

  35. I like the valuable info you provide in your articles. I will bookmark your blog and check again here regularly. I am quite certain I’ll learn a lot of new stuff right here! Best of luck for the next!

  36. I am now not certain the place you’re getting your info, however good topic. I needs to spend some time learning more or figuring out more. Thank you for magnificent info I was on the lookout for this information for my mission.

  37. I am now not certain the place you’re getting your info, however good topic. I needs to spend some time learning more or figuring out more. Thank you for magnificent info I was on the lookout for this information for my mission.

  38. I am now not certain the place you’re getting your info, however good topic. I needs to spend some time learning more or figuring out more. Thank you for magnificent info I was on the lookout for this information for my mission.

  39. Android Game Development takes more than knowledge

  40. Android Game Development takes more than knowledge

  41. Thanks so much for sharing this excellent info! I’m seeking forward to see much more posts!

  42. Thanks so much for sharing this excellent info! I’m seeking forward to see much more posts!

  43. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Outstanding work!

  44. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Outstanding work!

  45. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Outstanding work!

  46. Appreciating the time and energy you put into your blog and in depth information you provide. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed information. Excellent read! I’ve saved your site and I’m adding your RSS feeds to my Google account.

  47. Appreciating the time and energy you put into your blog and in depth information you provide. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed information. Excellent read! I’ve saved your site and I’m adding your RSS feeds to my Google account.

  48. Appreciating the time and energy you put into your blog and in depth information you provide. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed information. Excellent read! I’ve saved your site and I’m adding your RSS feeds to my Google account.

  49. Really wonderful information can be found on web blog.

  50. Really wonderful information can be found on web blog.

  51. Really wonderful information can be found on web blog.

  52. Hello There. I found your blog using msn. This is a really well written article. Ill make sure to bookmark it and return to read more of your useful information. Thanks for the post. I will definitely return.

  53. Hello There. I found your blog using msn. This is a really well written article. Ill make sure to bookmark it and return to read more of your useful information. Thanks for the post. I will definitely return.

  54. Hello There. I found your blog using msn. This is a really well written article. Ill make sure to bookmark it and return to read more of your useful information. Thanks for the post. I will definitely return.

  55. Hi Dear, are you in fact visiting this website daily, if so then you will definitely take fastidious knowledge.

  56. Hi Dear, are you in fact visiting this website daily, if so then you will definitely take fastidious knowledge.

  57. Hi Dear, are you in fact visiting this website daily, if so then you will definitely take fastidious knowledge.

  58. Hey very nice website!! Man .. Beautiful .. Amazing .. I’ll bookmark your website and take the feeds alsoI’m happy to find numerous useful information here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .

  59. Hey very nice website!! Man .. Beautiful .. Amazing .. I’ll bookmark your website and take the feeds alsoI’m happy to find numerous useful information here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .

  60. Hello! Do you use Twitter? I’d like to follow you if that would be okay. I’m undoubtedly enjoying your blog and look forward to new posts.

  61. Hello! Do you use Twitter? I’d like to follow you if that would be okay. I’m undoubtedly enjoying your blog and look forward to new posts.

  62. Hello! Do you use Twitter? I’d like to follow you if that would be okay. I’m undoubtedly enjoying your blog and look forward to new posts.

  63. If you are going for best contents like myself, just pay a quick visit this web page everyday since it offers feature contents, thanks

  64. If you are going for best contents like myself, just pay a quick visit this web page everyday since it offers feature contents, thanks

  65. This is really interesting, You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your magnificent post. Also, I have shared your web site in my social networks!

  66. This is really interesting, You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your magnificent post. Also, I have shared your web site in my social networks!

  67. Hey very nice website!! Man .. Beautiful .. Amazing .. I’ll bookmark your website and take the feeds alsoI’m happy to find numerous useful information here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .

  68. Hey very nice website!! Man .. Beautiful .. Amazing .. I’ll bookmark your website and take the feeds alsoI’m happy to find numerous useful information here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .

  69. Hey very nice website!! Man .. Beautiful .. Amazing .. I’ll bookmark your website and take the feeds alsoI’m happy to find numerous useful information here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .

  70. I’m glad that it turned out so effectively and I hope it will continue in the future because it is so worthwhile and meaningful to the community.

  71. I’m glad that it turned out so effectively and I hope it will continue in the future because it is so worthwhile and meaningful to the community.

  72. hi and thanks for the actual blog post ive recently been searching regarding this specific advice online for sum hours these days as a result thanks

  73. hi and thanks for the actual blog post ive recently been searching regarding this specific advice online for sum hours these days as a result thanks

  74. hi and thanks for the actual blog post ive recently been searching regarding this specific advice online for sum hours these days as a result thanks

  75. You’re so interesting! I don’t think I have read anything like this before. So wonderful to discover somebody with some unique thoughts on this subject matter. Seriously.. thank you for starting this up. This website is one thing that is needed on the internet, someone with a bit of originality!

  76. Thank you for the good writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! By the way, how can we communicate?

  77. I really appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thx again!

  78. I really appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thx again!

  79. Hi there! Someone in my Myspace group shared this site with us so I came to give it a appear. Im definitely loving the details. Im bookmarking and will likely be tweeting this to my followers! Outstanding blog and great style and style.

  80. Hi there! Someone in my Myspace group shared this site with us so I came to give it a appear. Im definitely loving the details. Im bookmarking and will likely be tweeting this to my followers! Outstanding blog and great style and style.

  81. Hi there! Someone in my Myspace group shared this site with us so I came to give it a appear. Im definitely loving the details. Im bookmarking and will likely be tweeting this to my followers! Outstanding blog and great style and style.

  82. Wow, marvelous blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is great, as well as the content!

  83. Wow, marvelous blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is great, as well as the content!

  84. Hey there! Do you know if they make any plugins to

  85. Hey there! Do you know if they make any plugins to

  86. Hey there! Do you know if they make any plugins to

  87. There are some attentiongrabbing points in time in this article but I dont know if I see all of them heart to heart. There may be some validity however I will take maintain opinion until I look into it further. Good article , thanks and we would like extra! Added to FeedBurner as properly

  88. There are some attentiongrabbing points in time in this article but I dont know if I see all of them heart to heart. There may be some validity however I will take maintain opinion until I look into it further. Good article , thanks and we would like extra! Added to FeedBurner as properly

  89. I do accept as true with all of the concepts you have offered in your post. They’re really convincing and will definitely work. Still, the posts are very brief for beginners. May you please extend them a little from next time? Thanks for the post.

  90. I do accept as true with all of the concepts you have offered in your post. They’re really convincing and will definitely work. Still, the posts are very brief for beginners. May you please extend them a little from next time? Thanks for the post.

  91. Appreciate it for helping out, great information.

  92. Appreciate it for helping out, great information.

  93. Appreciate it for helping out, great information.

  94. Valuable information. Fortunate me I discovered your web site by chance, and I am surprised why this coincidence didn’t happened in advance! I bookmarked it.

  95. Valuable information. Fortunate me I discovered your web site by chance, and I am surprised why this coincidence didn’t happened in advance! I bookmarked it.

  96. Valuable information. Fortunate me I discovered your web site by chance, and I am surprised why this coincidence didn’t happened in advance! I bookmarked it.

  97. Hello! This is my first comment here so I just wanted to give a quick shout out and tell you I really enjoy

  98. Hello! This is my first comment here so I just wanted to give a quick shout out and tell you I really enjoy

  99. Hello! This is my first comment here so I just wanted to give a quick shout out and tell you I really enjoy

  100. It’ll also save a lot of cash and time for those on

  101. It’ll also save a lot of cash and time for those on

  102. Magnificent website. Lots of useful information here. Im sending it to some friends ans also sharing in delicious. And obviously, thanks for your sweat!

  103. Magnificent website. Lots of useful information here. Im sending it to some friends ans also sharing in delicious. And obviously, thanks for your sweat!

  104. Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up. Grrrr well I’m not writing all that over again. Anyway, just wanted to say superb blog!

  105. Heya im for the first time the following. I discovered this specific table as a consequence I to discover The item faithfully of use &amp the idea rallied round myself publicized lots. I am hoping to deliver a little back again furthermore foster further like so

  106. Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up. Grrrr well I’m not writing all that over again. Anyway, just wanted to say superb blog!

  107. Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up. Grrrr well I’m not writing all that over again. Anyway, just wanted to say superb blog!

  108. I’m really enjoying the themedesign of your website. Do you ever run into any internet browser compatibility issues? A handful of my blog audience have complained about my site not operating correctly in Explorer but looks great in Firefox. Do you have any solutions to help fix this problem?

  109. I’m really enjoying the themedesign of your website. Do you ever run into any internet browser compatibility issues? A handful of my blog audience have complained about my site not operating correctly in Explorer but looks great in Firefox. Do you have any solutions to help fix this problem?

  110. I like the helpful information you provide for your articles. Ill bookmark your blog and check again right here frequently. I am quite certain Ill be informed many new stuff proper right here! Best of luck for the next!

  111. I like the helpful information you provide for your articles. Ill bookmark your blog and check again right here frequently. I am quite certain Ill be informed many new stuff proper right here! Best of luck for the next!

  112. I like the helpful information you provide for your articles. Ill bookmark your blog and check again right here frequently. I am quite certain Ill be informed many new stuff proper right here! Best of luck for the next!

  113. I’m really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, its rare to see a great blog like this one these days..

  114. I’m really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, its rare to see a great blog like this one these days..

  115. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why throw away your intelligence on just posting videos to your weblog when you could be giving us something enlightening to read?

  116. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why throw away your intelligence on just posting videos to your weblog when you could be giving us something enlightening to read?

  117. I simply couldn’t depart your web site prior to suggesting that I actually loved the usual info a person supply for your guests? Is gonna be again continuously in order to check up on new posts.

  118. I simply couldn’t depart your web site prior to suggesting that I actually loved the usual info a person supply for your guests? Is gonna be again continuously in order to check up on new posts.

  119. Fckin amazing things here. Im very glad to see your post. Thanks a lot and i’m looking forward to contact you. Will you kindly drop me a mail?

  120. Fckin amazing things here. Im very glad to see your post. Thanks a lot and i’m looking forward to contact you. Will you kindly drop me a mail?

  121. Beneficial Location Hi gentleman the following transpire a number of web page link with the aim of represses information that will a person may possibly acquire positive yourselves. The Significance Verifying away from home.

  122. Beneficial Location Hi gentleman the following transpire a number of web page link with the aim of represses information that will a person may possibly acquire positive yourselves. The Significance Verifying away from home.

  123. Beneficial Location Hi gentleman the following transpire a number of web page link with the aim of represses information that will a person may possibly acquire positive yourselves. The Significance Verifying away from home.

  124. It is rare for me to uncover something on the web thats as entertaining and intriguing as what you have got here. Your page is sweet, your graphics are great, and whats much more, you use source that are relevant to what youre saying. That you are undoubtedly one in a million, well done!

  125. It is rare for me to uncover something on the web thats as entertaining and intriguing as what you have got here. Your page is sweet, your graphics are great, and whats much more, you use source that are relevant to what youre saying. That you are undoubtedly one in a million, well done!

  126. Its really a great and useful piece of information. Im glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.

  127. Its really a great and useful piece of information. Im glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.

  128. Its really a great and useful piece of information. Im glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.