Magento升级时间太长,无法完成 [英] Magento upgrade takes too long and never completes

查看:69
本文介绍了Magento升级时间太长,无法完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将magento从1.4.0.1升级到1.7.0.2.最初有一些错误;修复这些问题后,现在升级将运行5个小时,并且从未完成.没有错误显示.知道为什么会发生吗?

I am upgrading magento from 1.4.0.1 to 1.7.0.2. Initially there were some errors; after fixing those, now the upgrade is running for 5 hours and never completes. No error is displaying. Any idea why it is happening?

推荐答案

I通过更改 lib \ Varien \ Db \ Adapter \ Pdo \ Mysql.php 文件中的以下行,在查询日志记录中进行操作

I On the query logging by changing the following lines in lib\Varien\Db\Adapter\Pdo\Mysql.php file

protected $_debug               = true;
protected $_logAllQueries       = true;
protected $_debugFile           = 'var/debug/pdo_mysql.log';

然后通过分析 pdo_myql.log 文件,我知道查询正在执行错误,因此magento安装程序一次又一次地运行它.

Then by analyzed the pdo_myql.log file I came to know that a query is executing with error and thus the magento installer run it again and again.

出错了.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ''11199-1' for key 'UNQ_INCREMENT_ID'

因此,我删除了数据库表中的条目,并删除了 pdo_mysql.log 中的条目,现在正在显示其他查询,并且升级完成.

So I deleted the entry in the database table and in pdo_mysql.log now other queries are displaying and the up-gradation is complete.

在magento升级上工作了很多天,我正在总结成功将magento从1.4.0.1升级到1.7.0.2的步骤.对于其他项目,显示的这些错误将有所不同,因为每个项目都有不同的数据.

Working many days on magento upgrade, I am summarizing the steps to successfully upgrading magento from 1.4.0.1 to 1.7.0.2. These errors displayed will be different for other projects because every project have different data.

  1. 为新版本创建新数据库. (我在用 SQLyog ,因为它适用于大型数据库的导入和导出).

  1. Create a fresh database for the new version. (I am using SQLyog because it is good for big database importing and exporting).

www htdocs 中提取并安装新版本1.7.0.1. 我的项目名称是 magento171 .

Extract and Install fresh version 1.7.0.1 in www or htdocs. My project name is magento171.

创建新数据库,因为在修复步骤中我们需要新数据库.

Create new database because we will need the fresh db in repair step.

旧数据库数据导入到新数据库.

在新安装的magento版本的 etc/local.xml 中更改新数据库名称.

Change the new database name in etc/local.xml in new installed version of magento.

etc/local.xml 中找到并将 SET NAMES utf8 更改为 SET NAMES utf8; SET FOREIGN_KEY_CHECKS = 0; SET UNIQUE_CHECKS = 0; .

以新版本的magento复制旧项目文件.我有主题 空白文件夹.如果默认情况下有模板文件,则复制默认值 文件夹.

Copy old project file in new version of magento. I have the theme in blank folder. Copy default if you have template files in default folder.

•app \ design \ frontend \ default \ blank

• app\design\frontend\default\blank

•应用\代码\本地

•皮肤\前端\默认/空白

• skin\frontend\default/blank

•app \ etc \ modules(复制不在新版本中的文件).

• app\etc\modules (copy the files which are not in the new version).

在MySql查询日志中,通过更改以下行 lib \ Varien \ Db \ Adapter \ Pdo \ Mysql.php

On the MySql queries logging by changing the following lines in lib\Varien\Db\Adapter\Pdo\ Mysql.php

 protected $_debug               = true;
 protected $_logAllQueries       = true;
 protected $_debugFile           = 'var/debug/pdo_mysql.log';

  • 搜索和更改 创建表如果不存在则创建表在代码/核心/法师/中.

  • Search and change CREATE TABLE to CREATE TABLE IF NOT EXISTS In code/core/mage/.

    更改表 core_config_data 中的以下条目(使用您的 项目文件夹名称).

    Change the following entries in the table core_config_data (use your project folder name).

      • web/unsecure/base_url | http://localhost/magento171/
      • web/secure/base_url   | http://localhost/magento171/
    

  • /errors/local.xml.sample 重命名为/errors/local.xml 以启用错误报告.

  • Rename /errors/local.xml.sample to /errors/local.xml to enable error_reporting .

    通过删除 var \ cache 中的所有数据来清除magento缓存.

    Clear the magento cache by delete all the data in var\cache.

    转到浏览器并输入您的项目路径. http://localhost/magento171/,并注意浏览器和 var/debug/pdo_mysql.log 文件.

    Go to browser and type the your project path. http://localhost/magento171/ and keep eyes on the browser and on the var/debug/pdo_mysql.log file.

    我遇到的第一个错误是:文件错误: "D:\ xampp \ htdocs \ magento171 \ app \ code \ core \ Mage \ Sales \ sql \ sales_setup \ mysql4-upgrade-1.3.99-1.4.0.0.php"

    The first error occurred to me is: Error in file: "D:\xampp\htdocs\magento171\app\code\core\Mage\Sales\sql\sales_setup\mysql4-upgrade-1.3.99-1.4.0.0.php"

    • SQLSTATE [23000]:违反完整性约束:1062键'PRIMARY'的重复条目'7'

    修复:在 pdo_mysql.log 文件中发现问题出在 sales_flat_order 表中,这意味着存在许多重复的主键条目,因此我将所有销售表.这实际上是我的旧数据库中的错误.在新版本中,increment_id为UNIQUE.我们不能跳过主键检查,因此我删去了与销售有关的所有表.如果您有相同的问题,则截断与该功能相关的所有表,例如如果客户重复,则截断所有客户表,或者如果目录中则截断目录表.但是请记住,在发生错误时应进行截断,因为如果在安装开始之前就被截断了,安装程序将不会读取现有数据,最后您会丢失一些记录,例如缺少某些订单或发票.

    Fix: I found from pdo_mysql.log file that the issue is in the sales_flat_order table, which means many duplicate entries for primary key are there so I truncate all the sales tables. This is actually the error in my old DB. In new version increment_id is UNIQUE. We can't skip primary key checks, so I truncated all the tables related to sales. If you have same issue then truncate all tables related to that feature like if duplicate in customer then truncate all customer table or if in catalog then truncate catalog tables. But remember truncate should be done at the time when the error is occured because if truncated before the installation begins the installer will not read the existing data and finally you will miss some records like missing some orders or invoices.

    SET FOREIGN_KEY_CHECKS = 0;
    TRUNCATE `sales_flat_creditmemo`;
    TRUNCATE `sales_flat_creditmemo_comment`;
    TRUNCATE `sales_flat_creditmemo_grid`;
    TRUNCATE `sales_flat_creditmemo_item`;
    TRUNCATE `sales_flat_invoice`;
    TRUNCATE `sales_flat_invoice_comment`;
    TRUNCATE `sales_flat_invoice_grid`;
    TRUNCATE `sales_flat_invoice_item`;
    TRUNCATE `sales_flat_order`;
    TRUNCATE `sales_flat_order_address`;
    TRUNCATE `sales_flat_order_grid`;
    TRUNCATE `sales_flat_order_item`;
    TRUNCATE `sales_flat_order_payment`;
    TRUNCATE `sales_flat_order_status_history`;
    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_quote_payment`;
    TRUNCATE `sales_flat_quote_shipping_rate`;
    TRUNCATE `sales_flat_shipment`;
    TRUNCATE `sales_flat_shipment_comment`;
    TRUNCATE `sales_flat_shipment_grid`;
    TRUNCATE `sales_flat_shipment_item`;
    TRUNCATE `sales_flat_shipment_track`;
    SET FOREIGN_KEY_CHECKS = 1;
    

  • 安装时间太长,因此我检查了 pdo_mysql.log 文件,并一次又一次显示以下错误.显示的错误:SQLSTATE [23000]:违反完整性约束:1062键"UNQ_INCREMENT_ID"的条目"11199-1"重复 使固定: 因此,我删除了表中的第一个条目.

  • The installation takes too long, so I inspect the pdo_mysql.log file and the following error is displaying again and again. Error displayed: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ''11199-1' for key 'UNQ_INCREMENT_ID'' Fix: So I delete the first entry in the table.

    数据库修复步骤:有必要使用 magento-db-repair-tool-1.1 (http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/db-repair-tool).报告结束时将显示所有修复程序.

    Database Rapair Step: It is necessary to Repair the new database with the fresh database using magento-db-repair-tool-1.1 (http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/db-repair-tool). It the end the report will show all the fixes.

    现在,您只需将网站转移到实时服务器即可.

    Now you can simply shift the website to the live server.

    这篇关于Magento升级时间太长,无法完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆