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 am upgrading magento from 1.4.0.1 to 1.7.0.2. Initially there were some errors; after
Share
I On the query logging by changing the following lines in lib\Varien\Db\Adapter\Pdo\Mysql.php file
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.
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.
Create a fresh database for the new version. (I am using
SQLyog because it is good for big database importing and exporting).
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.
Import the old database data into the new database.
Change the new database name in etc/local.xml in new installed version of magento.
In etc/local.xml find and change SET NAMES utf8 to SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0; .
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).
On the MySql queries logging by changing the following lines in
lib\Varien\Db\Adapter\Pdo\ Mysql.php
Search and change
CREATE TABLE to CREATE TABLE IF NOT EXISTS In code/core/mage/.
Change the following entries in the table core_config_data (use your
project folder name).
Rename /errors/local.xml.sample to /errors/local.xml to enable error_reporting .
Clear the magento cache by delete all the data in var\cache.
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.
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”
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.
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.
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.