<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elias Interactive &#187; delete test orders</title>
	<atom:link href="http://www.eliasinteractive.com/blog/tag/delete-test-orders/feed" rel="self" type="application/rss+xml" />
	<link>http://www.eliasinteractive.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 27 Aug 2010 16:34:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Magento eCommerce: How To Reset All Test Order Information and Set Unique Prefix For Orders, Invoices, Shipments, and Credit Memos</title>
		<link>http://www.eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos</link>
		<comments>http://www.eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos#comments</comments>
		<pubDate>Mon, 17 Nov 2008 00:58:53 +0000</pubDate>
		<dc:creator>Lee Taylor</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[create unique prefix for order numbers]]></category>
		<category><![CDATA[delete test orders]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento ecommerce]]></category>

		<guid isPermaLink="false">http://eliasinteractive.com/?p=401</guid>
		<description><![CDATA[<p>About: How To Reset Test Orders, Dashboard Information, and Set Unique Starting Values for Orders, Invoices, Shipments, and Credit Memos Who’s Interested: Informative to the technical... <a href="http://www.eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos"><br />Continue Reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos" height="61" width="51" /></a></div><p><!-- blockquote {background:none} --></p>
<p><strong>About:</strong> How To Reset Test Orders, Dashboard Information, and Set Unique Starting Values for Orders, Invoices, Shipments, and Credit Memos</p>
<p><strong>Who’s Interested:</strong> Informative to the technical gurus<br />
<strong>What:</strong> Plug &#8216;n Play Database Script that runs queries to customize after store is installed and product(s) have been created<br />
<strong>Magento Version Relevence:</strong> 1.1.6<br />
<strong>Magento Store Setup:</strong> Single-Store Setup</p>
<p>A client of ours went in to test products, orders, invoices, etc. to get the feel for the overall &#8220;purchase order to shipment&#8221; process from start to finish. After creating many test users, orders, etc. &#8211; they now desire to have everything reset back to &#8220;0&#8243; (zero).</p>
<p>Not only that, but they also want to separate the prefixes for the following items just for ease of dissimilarity when using the Magento ADMIN tools:</p>
<ul>
<li>Orders (set prefix to begin with &#8220;1&#8243;)</li>
<li>Invoices (set prefix to begin with &#8220;2&#8243;)</li>
<li>Shipments (set prefix to begin with &#8220;3&#8243;)</li>
<li>Credit Memo&#8217;s (set prefix to begin with &#8220;4&#8243;)</li>
</ul>
<p>Thus, we have the following script (and a special thanks to Tomislav at Inchoo for <a href="http://inchoo.net/ecommerce/magento/delete-test-orders-in-magento/" target="_blank">getting us started</a>!)</p>
<p><strong>Instructions</strong>:</p>
<ol>
<li>Find &#8220;YOUR_DB_NAME&#8221; down below and change to match your database name (though leave the ticks &#8220;)</li>
<li>Copy and paste code into SQL manager (PhpMyAdmin or similar) and then run the query</li>
<li>Feel free to Create test order, invoice, shipment, and credit memo&#8217;s via the ADMIN (easier than going through order process on frontend)</li>
<li>Once you like the changes you see, go back and run the same SQL query</li>
<p>&#8230;the following will now be in effect:</p>
<ul>
<li>All data pertaining to orders and search terms (Dashboard) are reset to 0 (zero)</li>
<li>Order number prefix with 0, Invoice number prefix with 2, Shipment number prefix with 3, Credit Memo number prefix with 4</li>
</ul>
</ol>
<p><strong>Please feel free to copy and paste into your PhpMyAdmin</strong></p>
<pre class="brush: sql;">
-- Reset Magento TEST Data

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_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_text`;
TRUNCATE `sales_order_varchar`;
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_order_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;

ALTER TABLE `sales_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_varchar` 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_order_item` 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;

-- Reset all ID counters
TRUNCATE `eav_entity_store`;
ALTER TABLE  `eav_entity_store` AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS=1;

-- set appropriate prefixes for orders, invoices, shipments, credit memos
INSERT INTO  `YOUR_DB_NAME`.`eav_entity_store` (`entity_store_id` ,`entity_type_id` ,`store_id` ,`increment_prefix` ,`increment_last_id`) VALUES ('1',  '11',  '1',  '1',  '000000000');
update `eav_entity_store` set `increment_prefix`= 1 where `entity_type_id`='4' and `store_id`='1';
update `eav_entity_store` set `increment_last_id`= '000000000' where `entity_type_id`='4' and `store_id`='1';

INSERT INTO  `YOUR_DB_NAME`.`eav_entity_store` (`entity_store_id` ,`entity_type_id` ,`store_id` ,`increment_prefix` ,`increment_last_id`) VALUES ('2',  '16',  '1',  '2',  '000000000');
update `eav_entity_store` set `increment_prefix`= 2 where `entity_type_id`='18' and `store_id`='1';
update `eav_entity_store` set `increment_last_id`= '000000000' where `entity_type_id`='18' and `store_id`='1';

INSERT INTO  `YOUR_DB_NAME`.`eav_entity_store` (`entity_store_id` ,`entity_type_id` ,`store_id` ,`increment_prefix` ,`increment_last_id`) VALUES ('3',  '19',  '1',  '3',  '000000000');
update `eav_entity_store` set `increment_prefix`= 3 where `entity_type_id`='24' and `store_id`='1';
update `eav_entity_store` set `increment_last_id`= '000000000' where `entity_type_id`='24' and `store_id`='1';

INSERT INTO  `YOUR_DB_NAME`.`eav_entity_store` (`entity_store_id` ,`entity_type_id` ,`store_id` ,`increment_prefix` ,`increment_last_id`) VALUES ('4',  '23',  '1',  '4',  '000000000');
update `eav_entity_store` set `increment_prefix`= 4 where `entity_type_id`='28' and `store_id`='1';
update `eav_entity_store` set `increment_last_id`= '000000000' where `entity_type_id`='28' and `store_id`='1';
</pre>
<p>For SQL Script download: <a href="http://www.eliasinteractive.com/wp-content/uploads/2008/11/magento_db_change.sql">Magento Database Modifications</a></p>
<p>Let us know how you like it!</p>
<p>Thanks,<br />
Lee Taylor</p>
<a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Digg" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Google Reader" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a> <a href="http://www.addtoany.com/add_to/gmail?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Gmail" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Gmail"/></a> <a href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a> <a href="http://www.addtoany.com/add_to/blogger_post?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos" title="Blogger Post" rel="nofollow" target="_blank"><img src="http://www.eliasinteractive.com/wp-content/plugins/add-to-any/icons/blogger.png" width="16" height="16" alt="Blogger Post"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos&amp;linkname=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C%20Invoices%2C%20Shipments%2C%20and%20Credit%20Memos">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos/feed</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
	</channel>
</rss>
