Magento World

As a Magento parner, we are very honoured to offer you the best Magento Extensions, Magento Modules, Magento Themes and Magento Templates. You will get full support until you feel satisfied! View our Magento page to find what you need!

Thứ Tư, 28 tháng 3, 2012

Moving Magento Database to a New Server

I’ve been moving databases quite a lot recently, and the Magento database is a heavy one to lift. Based on recent experiences there’s two things you don’t want to miss. These tips are relevant for Magento 1.5, but should work on later versions.

Though Magento is built using the EAV structure, it is still a relational database at its core and as such its tables rely entirely on the existence of foreign keys. You can experience problems exporting and importing your database if foreign key checks are too rigid. In many cases a table with a required foreign key may not exist while part of the query is carried out.

In phpMyAdmin and most other database management systems it will be possible to disable foreign key checks so that constraints are exempt from the query. Simply check ‘Disable foreign key checks’ while exporting.

phpMyAdmin

Once your database has imported you’ll need to run this query in order to establish access to the admin area. The store and website IDs need to be set 0 which somehow gets lost in translation during the move.

You can read the post here: http://stackoverflow.com/questions/5178066/error-404-not-found-in-magento-admin-login-page

SET FOREIGN_KEY_CHECKS=0;UPDATE `core_store` SET store_id = 0 WHERE code='admin';UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';UPDATE `core_website` SET website_id = 0 WHERE code='admin';UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';SET FOREIGN_KEY_CHECKS=1;

These two steps should mean that your database has been correctly transferred.

Thanks for reading the Magento Blog at Ecommerce Web Design – have a Merry Christmas and Happy New Year everyone.

Adam Moss Author Page


View the original article here

Không có nhận xét nào:

Đăng nhận xét