Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:50:33+00:00 2026-06-14T08:50:33+00:00

I am upgrading magento from 1.4.0.1 to 1.7.0.2. Initially there were some errors; after

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:50:35+00:00Added an answer on June 14, 2026 at 8:50 am

    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';
    

    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.

    Error was.

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

    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.

    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. Create a fresh database for the new version. (I am using
      SQLyog because it is good for big database importing and exporting).

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

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

    4. Import the old database data into the new database.

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

    6. In etc/local.xml find and change SET NAMES utf8 to SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0; .

    7. 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\code\local

      • skin\frontend\default/blank

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

    8. 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';
      
    9. Search and change
      CREATE TABLE to CREATE TABLE IF NOT EXISTS In code/core/mage/.

    10. 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/
      
    11. Rename /errors/local.xml.sample to /errors/local.xml to enable error_reporting .

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

    13. 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.

    14. 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]: Integrity constraint violation: 1062 Duplicate entry ‘7’ for key ‘PRIMARY’

      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;
      
    15. 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.

    16. 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.

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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After upgrading magento from 1.4.0.1 to 1.5.1.0 , i'm not able to submit an
After upgrading to Magento 1.6.2.0 (from 1.4) the product_option field in table sales_flat_order_item doesn’t
After upgrading from ExtJS 4.0.7 to 4.1, I'm facing a layout issue. There are
After upgrading from Cake 1.3 to 2.0 I I'm getting missing table errors for
After upgrading from TFS 2008 to 2010 and running crazy having the build to
When i upgrading magento site from older version to latest version i got some
After upgrading my Magento installation from 1.3.2.1 to 1.7.0.2 I get the following error
Upgrading from ASP.NET WebAPI Beta to RC has provided some amount of excitement and
After upgrading to a newer hibernate version (guess it came with the switch from
After upgrading node to v0.8.1, bundled Meteor apps now throw an error: node: symbol

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.