Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Upgrading 1.5.1.0 to 1.6.2.0
 
tipofloe
Jr. Member
 
Total Posts:  23
Joined:  2009-02-17
 

Hello everyone,

I am developing a site based on 1.5.1.0.  I use Hostmonter, and they no longer support upgrades from 1.5.1.0 and beyond. 

I’ve tried the manual upgrade via SSH, which was a disaster. 

I’ve tried every possible solution there is out there, but I’m not a developer, and I don’t know much about the code.  I couldn’t even get the DB dump as per wiki due to so many error messages.  The SSH way of manual upgrade kept putting me on a message like “I must be running magento connect” despite sending in the command many times to run Magento Connect. 

So what I did was a fresh install of 1.6.2.0 and the tried to import the database that I’ve backed up via Magento tools - backup and use phpMyAdmin to import the database, but I get the following error message:

SQL query:

CREATE TABLE `mgn_directory_country_region` (

`region_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`country_id` VARCHAR( 4 ) NOT NULL DEFAULT ‘0’,
`code` VARCHAR( 32 ) NOT NULL DEFAULT ‘’,
`default_name` VARCHAR( 255 ) DEFAULT NULL ,
PRIMARY KEY ( `region_id` ) ,
KEY `FK_REGION_COUNTRY` ( `country_id` )
) ENGINE = INNODB AUTO_INCREMENT =485 DEFAULT CHARSET = utf8 COMMENT = ‘Country regions’;

MySQL said:

#1005 - Can’t create table ‘cctvrepo_mgn1.mgn_directory_country_region’ (errno: 150) (Details...)

Again, this is what I have and I am desperately looking for solutions:

1.  was running 1.5.1.0 fine.
2.  DB is backed up using tools - backup in Magento admin
3.  deleted the entire 1.5.1.0 install
4.  reinstalled 1.6.2.0 fresh

All I need to do now is to import the old DB and make it work, but I’m stuck at what you see above. 

Any help is appreciated. 

Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

You can try a couple of things:

1) I would always restart your upgrade with a fresh version of your 1.5 database, don’t use a database that has been started

2) Since you have a backup, you could try dropping that table and let Magento re-create it

3) You can find the sql script and add if not exists to the create statement

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alexandrable
Member
 
Total Posts:  55
Joined:  2011-09-01
 

I believe the best way out in your case is use external help in moving your db to the new Magento installation. There’s the whole bunch of them on Magento Connect. If you’re not a programmer, you really need to consider this. You’d pay for the extension, but it would be much less than you’d spend your time and resources on finding the right solution.

On my part, I’d advise this: http://www.shopping-cart-migration.com/shopping-cart-migration-options/223-magento-to-magento-migration. It starts from only $49, so shouldn’t be too expensive.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lucrian
Member
 
Avatar
Total Posts:  43
Joined:  2010-04-16
Galaţi, România, Europa, Terra, Calea Laptelui
 

I’m trying to upgrade from 1.5.1.0 to 1.6.2.0, using reinstalling the magento to another server.

I’ve installed normally magento 1.6.2.0 to new server using the same key in local.xml, I’ve replaced the 1.6.2.0 database with my old database from 1.5.1.0. When I’ve accessed the website I’ve received an error:

"Error in file: "/xxx/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php" - SQLSTATE[HY000]: General error: 1025 Error on rename of './magento/#sql-92e_2a73' to './magento/mag_cataloginventory_stock_item' (errno: 150)";i:1;s:1046:"#0 /xxx/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')

Table ‘mag_cataloginventory_stock_item’ is InnoDB already.

Unfortunately I don’t find any solution in section Potential problems with your upgrade from http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/magento_1.5_to_1.6_upgrade

What to do?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lucrian
Member
 
Avatar
Total Posts:  43
Joined:  2010-04-16
Galaţi, România, Europa, Terra, Calea Laptelui
 

After 2 days of tries to upgrade with several methods, I\’ve decided to wrote here and after that to continue to search a solution myself and maybe somebody give me here a solution. However, I\’ve already found it and if somebody get similar error, I suggest to look at INDEXes.

For me, after resolving indexes from a table, comes another similar error. So, below I\’ve wrote the lines executed in mysql which was drive me to upgrade successfully to 1.6.2.0. I recommend you to run those lines for each table only if is needed.
Please note: my tables prefix is: mag_

ALTER TABLE mag_cataloginventory_stock_item DROP INDEX FK_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID ADD INDEX IDX_MAG_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID product_id )
ALTER TABLE mag_cataloginventory_stock_item DROP INDEX FK_CATALOGINVENTORY_STOCK_ITEM_STOCK_ID ADD INDEX IDX_MAG_CATALOGINVENTORY_STOCK_ITEM_STOCK_ID stock_id )
ALTER TABLE mag_cataloginventory_stock_item ADD UNIQUE INDEX UNQ_MAG_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID product_idstock_id )
ALTER TABLE mag_cataloginventory_stock_status DROP INDEX FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE ADD INDEX IDX_MAG_CATALOGINVENTORY_STOCK_STATUS_WEBSITE_ID website_id )
ALTER TABLE mag_cataloginventory_stock_status DROP INDEX FK_CATALOGINVENTORY_STOCK_STATUS_STOCK ADD INDEX IDX_MAG_CATALOGINVENTORY_STOCK_STATUS_STOCK_ID stock_id )
ALTER TABLE mag_api_rule DROP INDEX role_id ADD INDEX IDX_MAG_API_RULE_ROLE_ID_RESOURCE_ID role_idresource_id )
ALTER TABLE mag_api_rule ADD INDEX IDX_MAG_API_RULE_RESOURCE_ID_ROLE_ID resource_idrole_id )
ALTER TABLE mag_api_session DROP INDEX API_SESSION_USER ADD INDEX IDX_MAG_API_SESSION_USER_ID user_id )
ALTER TABLE mag_api_session DROP INDEX API_SESSION_SESSID ADD INDEX IDX_MAG_API_SESSION_SESSID sessid )

Good luck!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top