<?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>Ecommerce consulting &#38; solutions for online store retailers</description>
	<lastBuildDate>Thu, 01 Sep 2011 18:45:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<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[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 gurus What: Plug &#8216;n Play Database Script that runs queries to customize after store is installed and product(s) have been created Magento Version Relevence: &#8230; <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/">Continue Reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<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; title: ; notranslate">
-- 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
<div id="tweetbutton401" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fbit.ly%2FmiEFo0&amp;via=tweetelias&amp;text=Magento%20eCommerce%3A%20How%20To%20Reset%20All%20Test%20Order%20Information%20and%20Set%20Unique%20Prefix%20For%20Orders%2C...%20&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=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%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.eliasinteractive.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
]]></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>98</slash:comments>
		</item>
	</channel>
</rss>

