Jump to content

Prestashop 1.4 system reset


Recommended Posts

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

My suggestion is the following but I don't know if it's right

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_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

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

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.

Ciao
Jacky75

Link to comment
Share on other sites

  • 3 weeks later...

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

  • 5 months later...

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...