Magento … how I love/hate thee …

Oh, Magento …
For those of you that are still living in the Stone Age (or those of you who don’t spend their free time researching open-source e-commerce platforms), Magento is a groundbreaking piece of software that basically splits the gap between the dated, functionality-deprived open-source platforms and the big, sexy (read: expensive) enterprise systems. Magento lands at a nice spot in the mid-market sector and having been downloaded 600,000+ times since it’s alpha release in the beginning of Q2, has certainly made quite the buzz in the e-retail community.
Having used Magento since it’s first public beta, I feel like I have been raising a child not unlike myself: absentmindedly-sophisticated-with-a-hint-of-logical-defiance. My relationship with Magento is the epitome of love / hate. We have had our beautiful moments when I realize my checkout process is just screaming high conversions and plugging-in with a third-party service is as simple as supplying API credentials. Other times, the only thing I’ve hated more then Magento are the software it was built to replace (read: x-cart, OS Commerce).
Magento makes the complex tasks simple and the straightforward tasks absolutely torturous .. for example:
Want to create a turn-key multi-channel e-retail store with guided navigation, single-page AJAX checkout, dynamic merchandising, complex promotions and a powerful data input/output engine? NO PROBLEM!!
Want to remove test orders from the database / backend? NO PROBLEM ……… just run this SQL query against your database:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | SET FOREIGN_KEY_CHECKS=0;TRUNCATE `catalogsearch_query`; -- added TRUNCATE `catalogsearch_result`; -- added TRUNCATE `log_quote`; TRUNCATE `report_event`; TRUNCATE `sales_flat_order_item`; 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`; -- added TRUNCATE `sales_flat_quote_shipping_rate`; -- added TRUNCATE `sales_order`; TRUNCATE `sales_order_datetime`; TRUNCATE `sales_order_decimal`; TRUNCATE `sales_order_entity`; TRUNCATE `sales_order_entity_datetime`; TRUNCATE `sales_order_entity_decimal`; TRUNCATE `sales_order_entity_int`; TRUNCATE `sales_order_entity_text`; TRUNCATE `sales_order_entity_varchar`; TRUNCATE `sales_order_int`; TRUNCATE `sales_order_tax`; -- added TRUNCATE `sales_order_text`; TRUNCATE `sales_order_varchar`; TRUNCATE `sendfriend_log`; TRUNCATE `tag`; TRUNCATE `tag_relation`; TRUNCATE `tag_summary`; TRUNCATE `wishlist`; TRUNCATE `wishlist_item`; -- added -- reset 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_entity`; TRUNCATE `customer_entity_datetime`; TRUNCATE `customer_entity_decimal`; TRUNCATE `customer_entity_int`; TRUNCATE `customer_entity_text`; TRUNCATE `customer_entity_varchar`; TRUNCATE `log_customer`; TRUNCATE `log_visitor`; TRUNCATE `log_visitor_info`; -- Reset all ID counters -- Some payment gateways need a unique transaction reference for every order, -- reseting your order ID may result in future transaction errors! -- (so only do this if you are sure it wont be a problem) -- TRUNCATE `eav_entity_store`; SET FOREIGN_KEY_CHECKS=1; |
No folks, not kidding.
(This criticism isn’t completely fair … but …) I suppose you cannot expect a company whose revenue model is built off support to make their product too easy to use.
At the end of the day, it is still an great piece of open-source software that is only getting better and will pave the way for many new and established e-commerce properties. I for one will continue our box-of-chocolates / Freddy Krueger relationship until something better comes along.




I am John Roa, a web entrepreneur from Chicago. Welcome to my blog!
If your mysql has innodb enabled and configured correctly, these should be sufficient:
TRUNCATE `customer_entity`;
TRUNCATE `report_event`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_order`;
TRUNCATE `tag`;
TRUNCATE `wishlist`;
TRUNCATE `catalogsearch_query`;
TRUNCATE `catalogsearch_result`;
TRUNCATE `sendfriend_log`;
TRUNCATE `log_customer`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;
TRUNCATE `log_quote`;
I do not think this is overly excessive for complete test db cleanup
What would it be for oscommerce?
UPDATE: This one is not needed:
TRUNCATE `catalogsearch_result`;
Unirgy, thanks for the feedback!
You are absolutely right that the SQL could be simplified …
However, the case still stands – even if it is a single line – you should not need to run an unofficial SQL script against your database to clean up test orders. Most other systems (including OS Commerce) includes a neat little button in the administrative area that allows you to do this. A non-technical user could get a Magento store up and running with no problems. They shouldn’t be forced to access their raw database and run SQL statements in order to perform such basic tasks.
The wider net is around the fundamental issue: why *aren’t* these boxed functionalities in Magento, when it does so many other more advanced things without a hitch?
I would say it slipped their mind.
When you’re used to build websites for other people, they rely on you to do all the technical stuff for them, they don’t ask you to give them user-friendly control over all aspects of their database. So you build the site, they test and happy, ask you to deploy the application and clean db to their production server, and that’s it – they won’t ever need the functionality of cleaning up database from their admin interface, so there’s none.
I’m sure that over time Magento will get all the functionality there’s a demand for, either through core functionality or extensions.
Well hello Moshe! You’re the Magento developer, right? I had to do a little bit of digging before discovering who would be defending Magento to the point of analyzing SQL queries
Your logic is spot on … I truly appreciate and value your feedback and participation – however …
Well, nice job doing the research
But I’m not core Magento developer for almost half a year now, freelancing with Magento projects.
I’m going to ramble a bit now, mostly due to sleepless night and lots of coffee, feel free to skip it
I do understand what you’re saying and can’t say I disagree with your feelings, but what I can say is, unfortunately we’re living in a sparce world, where resources are limited and there’s a need to make decisions over the most efficient use of available resources.
Our decisions are based on priorities and everybody has different set of priorities based on their personal history, skill set, interests, position in society, specific situation, etc. It is virtually impossible to get into someone else’s shoes.
Not going to far, developers’ priorities are different from users’, managers’ priorities are different from developers’, etc.
So what I’m getting to is, while you strongly prioritize some things, you have to accept that others might see different things more important and urgent to implement, sacrificing your priorities, and that’s perfectly legal as long as the decision is made over their domain, because in the end we have to take care of ourselves (survive, stay afloat, etc.), so other can benefit from our contributions to the world.
Trying to adhere to priorities of other people instead of making your own decisions may and will destroy your life, I hope you can agree with me here.
I can assure you that Magento team do not rest on laurels, work very hard, and use the best of their skills and abilities to bring Magento even further.