jacky75 Posted February 20, 2011 Share Posted February 20, 2011 Hi,we're developing an important project on the version 1.4. When the final version will be available and we will be ready, it will be necessary to remove all test data from the database.Applying the info about resetting 1.3 I think the DB it's not completely cleaned because in 1.4 there are many new feautures (e.g. stock movements history).Thus, is there anyone who know exactly the list of tables it's necessary to truncate?For user I want to keep safe the products and the catalogs, but I need to delete users, last access info, carts, orders, vouchers, etc....Regards, Link to comment Share on other sites More sharing options...
Pinkloveshy Posted February 20, 2011 Share Posted February 20, 2011 HiI would also like this information if possible.Can anyone supply?Many thanks in advanceRegardsPinkloveshy Link to comment Share on other sites More sharing options...
jacky75 Posted February 22, 2011 Author Share Posted February 22, 2011 My suggestion is the following but I don't know if it's rightTRUNCATE TABLE `ps_customer`;TRUNCATE TABLE `ps_address`;TRUNCATE TABLE `ps_orders`;TRUNCATE TABLE `ps_order_detail`;TRUNCATE TABLE `ps_order_discount`;TRUNCATE TABLE `ps_order_history`;TRUNCATE TABLE `ps_message`;TRUNCATE TABLE `ps_cart`;TRUNCATE TABLE `ps_cart_product`;TRUNCATE TABLE `ps_cart_discount`;TRUNCATE TABLE `ps_customer_group`;TRUNCATE TABLE ps_connections;TRUNCATE TABLE ps_access;TRUNCATE TABLE ps_discount;TRUNCATE TABLE ps_discount_category;TRUNCATE TABLE ps_discount_lang;TRUNCATE TABLE ps_message_readed;TRUNCATE TABLE ps_order_slip;TRUNCATE TABLE ps_order_slip_detail;TRUNCATE TABLE ps_stock_mvt; Link to comment Share on other sites More sharing options...
jacky75 Posted February 22, 2011 Author Share Posted February 22, 2011 Proposed solution was wrong for sure. Now I'm testing:TRUNCATE TABLE `ps_customer`;TRUNCATE TABLE `ps_address`;TRUNCATE TABLE `ps_orders`;TRUNCATE TABLE `ps_order_detail`;TRUNCATE TABLE `ps_order_discount`;TRUNCATE TABLE `ps_order_history`;TRUNCATE TABLE `ps_message`;TRUNCATE TABLE `ps_cart`;TRUNCATE TABLE `ps_cart_product`;TRUNCATE TABLE `ps_cart_discount`;TRUNCATE TABLE `ps_customer_group`;TRUNCATE TABLE ps_connections;TRUNCATE TABLE ps_discount;TRUNCATE TABLE ps_discount_category;TRUNCATE TABLE ps_discount_lang;TRUNCATE TABLE ps_message_readed;TRUNCATE TABLE ps_order_slip;TRUNCATE TABLE ps_order_slip_detail;TRUNCATE TABLE ps_stock_mvt; Link to comment Share on other sites More sharing options...
Pinkloveshy Posted February 27, 2011 Share Posted February 27, 2011 thanks JackyWhen you finalise would love to now the positionRegardsPinkloveshy Link to comment Share on other sites More sharing options...
jacky75 Posted February 28, 2011 Author Share Posted February 28, 2011 it seems the last posted process is working.I mean, after applying it on two instances, we've been able to create new customers, orders, products, categories, vouchers... without issues.I still hope someone from Prestashop will officially post an answer.I'll wait also comment from other people.CiaoJacky75 Link to comment Share on other sites More sharing options...
mooshi Posted February 28, 2011 Share Posted February 28, 2011 Hi! Jacky75Thanks for this...I was wondering about this myself, but was not sure of the implications, if any would have on future orders etcccc....After you truncate the tables, did you have to optimize them at all? or you suggest to? Link to comment Share on other sites More sharing options...
jacky75 Posted February 28, 2011 Author Share Posted February 28, 2011 Hi,reading at the url below about mysql TRUNCATE statement it seems it could be necessary to optmize. Do you agree?http://dev.mysql.com/doc/refman/5.1/en/truncate-table.html Link to comment Share on other sites More sharing options...
mooshi Posted February 28, 2011 Share Posted February 28, 2011 I think may be good idea..... Link to comment Share on other sites More sharing options...
jacky75 Posted March 18, 2011 Author Share Posted March 18, 2011 Hi,I found the prosed solution is missing two tables. The new version (please report any issue if something will go wrong) is TRUNCATE TABLE `ps_customer`;TRUNCATE TABLE `ps_address`;TRUNCATE TABLE `ps_orders`;TRUNCATE TABLE `ps_order_detail`;TRUNCATE TABLE `ps_order_discount`;TRUNCATE TABLE `ps_order_history`;TRUNCATE TABLE `ps_message`;TRUNCATE TABLE `ps_cart`;TRUNCATE TABLE `ps_cart_product`;TRUNCATE TABLE `ps_cart_discount`;TRUNCATE TABLE `ps_customer_group`;TRUNCATE TABLE ps_connections;TRUNCATE TABLE ps_discount;TRUNCATE TABLE ps_discount_category;TRUNCATE TABLE ps_discount_lang;TRUNCATE TABLE ps_message_readed;TRUNCATE TABLE ps_order_slip;TRUNCATE TABLE ps_order_slip_detail;TRUNCATE TABLE ps_stock_mvt;TRUNCATE TABLE ps_order_return;TRUNCATE TABLE ps_order_return_detail; Link to comment Share on other sites More sharing options...
Billy Posted September 17, 2011 Share Posted September 17, 2011 Hi, I found the prosed solution is missing two tables. The new version (please report any issue if something will go wrong) is TRUNCATE TABLE `ps_customer`; TRUNCATE TABLE `ps_address`; TRUNCATE TABLE `ps_orders`; TRUNCATE TABLE `ps_order_detail`; TRUNCATE TABLE `ps_order_discount`; TRUNCATE TABLE `ps_order_history`; TRUNCATE TABLE `ps_message`; TRUNCATE TABLE `ps_cart`; TRUNCATE TABLE `ps_cart_product`; TRUNCATE TABLE `ps_cart_discount`; TRUNCATE TABLE `ps_customer_group`; TRUNCATE TABLE ps_connections; TRUNCATE TABLE ps_discount; TRUNCATE TABLE ps_discount_category; TRUNCATE TABLE ps_discount_lang; TRUNCATE TABLE ps_message_readed; TRUNCATE TABLE ps_order_slip; TRUNCATE TABLE ps_order_slip_detail; TRUNCATE TABLE ps_stock_mvt; TRUNCATE TABLE ps_order_return; TRUNCATE TABLE ps_order_return_detail; Has this changed since you have been testing this Jacky75? My shop is currently @ 1.4.2.5 and i do intend to upgrade once I get this whole store cloned over to a new domain. Looks like I should add these below to finish a clean clone over to other domain. TRUNCATE ps_connections; TRUNCATE ps_connections_page; TRUNCATE ps_connections_source; TRUNCATE ps_guest; TRUNCATE ps_page; TRUNCATE ps_pagenotfound; TRUNCATE ps_page_viewed; TRUNCATE ps_page_type; TRUNCATE ps_paypal_order; TRUNCATE ps_search_index; TRUNCATE ps_search_word; TRUNCATE ps_statssearch; TRUNCATE ps_date_range; INSERT INTO `ps_page_type` (`id_page_type`, `name`) VALUES (NULL , 'product.php'), (NULL , 'category.php'), (NULL , 'order.php'), (NULL , 'manufacturer.php'); Has this worked for everyone? Link to comment Share on other sites More sharing options...
jacky75 Posted September 19, 2011 Author Share Posted September 19, 2011 Hi, I can confirm I'm still using the last query I posted. About your suggestions, I havent' got the time to test them, but I'm already thinking about why you're truncating "ps_page_type" and "ps_page". May you describe it? Regards, Jacky75 Link to comment Share on other sites More sharing options...
Billy Posted September 21, 2011 Share Posted September 21, 2011 Hi, I can confirm I'm still using the last query I posted. About your suggestions, I havent' got the time to test them, but I'm already thinking about why you're truncating "ps_page_type" and "ps_page". May you describe it? Regards, Jacky75 Well I am cloning websites over to other domains. I didn't want to have all the stats carry over so this is my way of uninstalling the stats module then reinstalling. I added 5 more lines to the above to get a really clean clone. TRUNCATE ps_connections_source; TRUNCATE ps_paypal_order; TRUNCATE ps_search_index; TRUNCATE ps_search_word; TRUNCATE ps_statssearch; All this dropped my 60 meg database down to 1.8 megs and lets just say that in itself is impressive! Link to comment Share on other sites More sharing options...
Billy Posted September 21, 2011 Share Posted September 21, 2011 I kept running the ps_delivery and deleting my shipping setup so that one is a no no in my case. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now