1
votes

I am upgrading an existing magento website for 1.4 to 1.6.1.0.

  • I had dumped the existing database,
  • Copied all the required custom extension in the blank magento version 1.6.1.0

and after running the installation got the following error:

Error in file: "/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php" - SQLSTATE[HY000]: General error: 1025 Error on rename of './sales_flat_order' to './#sql2-3af-a7' (errno: 152)

How can I fix this issue?

4

4 Answers

1
votes

Upgrading magento is very painful process. I suggest you to import-export data from old to new shop.

0
votes

I just went through the same heartburn. I found that letting the page try to load until the script got an error or timed out and then trying again eventually worked. The upgrade script will attempt to start where it last stopped.

Before you do that, make a backup of you site and database. If it continually errors in the same spot, restore and try again.

These tips may help improve the odds of a quicker success:

  • Put the site in maintenance mode (by adding the maintenance.flag file to the root directory) before starting.
  • Increase server and php timeouts by a very large amount (3-5minutes).
  • Cleanup temp and log database tables that you don't care about (carefully, everybody has different needs here)

I tried several different methods and that is the only thing that worked. It took probably 10 reloads (waiting for a 3min timeout each time). In the end, everything upgraded correctly. No matter what method you choose, if you want to keep your store data, you will have to run the bulky db upgrade scripts that take forever.

0
votes

I had similar issues when updating from 1.4.2 to latest. I built a custom maintenance script included in my index.php that only allowes to access my ip. But the update process via shell replaced my index.php so it was accessible for everyone. That was the cause that the final sql scripts where run by several clients and caused errors like "can't move table" etc. because those steps where already done.

--> Summing it up: Be sure that the site gets called only once, until the upgrade was successful!

0
votes

The very best way to migrate magento in my opinion, is to import your entire db to an environment that you have your new magento. Then magento will run all scripts and updates and keep your data. Maybe you find some problems on the upgrade scripts, but it's easier to fix them than fix the problems regarding model/eav's problems on the fly.

I have succeed by doing this on migrate from 1.4.1 to 1.8.1.