magento升级表格1.4.0.1到1.7.0.2我缺少订单和发票记录

时间:2012-10-25 13:53:11

标签: php mysql magento-1.4 magento-1.7 duplicates

参考这个问题magento upgrad from 1.4.0.1 to 1.4.2.0

现在我遗漏了订单和发票中的许多记录。如何解决它并获得我的所有订单和发票。

更多我也升级到1.7.0.2,它也有同样的问题。

1 个答案:

答案 0 :(得分:-1)

我找到了与销售和订单相关的表格,还找到了什么是广告订单。正如我在上一个问题中提到的,升级运行时会出现错误。错误是在sales sql文件中找到的重复条目。所以我运行以下查询,现在升级正在从销售表开始。

TRUNCATE `sales_flat_quote_address`; 
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_quote_address_item`; 
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_quote_item`; 
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_quote_item_option`; 
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_quote_payment`; 
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_invoice`; 
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_invoice_comment`; 
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_invoice_grid`; 
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_invoice_item`; 
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_creditmemo`; 
ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_creditmemo_comment`; 
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_creditmemo_grid`; 
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_creditmemo_item`; 
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_shipment`; 
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_shipment_grid`; 
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1; 
TRUNCATE `sales_flat_shipment_item`; 
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1; 
SET FOREIGN_KEY_CHECKS = 1;