Problem:
I transferred my Magento site files from one computer to another. I imported the database. Now, when I try to login to admin (when I go to admin login url), it shows 404 Not Found Error page. The same error is also displayed in the module’s page that are installed in site.
However, the frontend part is working fine. There is no such error in browsing categories and pages in frontend.
Cause:
If you have enabled System Log in Magento then you can see the log. It is present in var/log/system.log.
It shows the following error:-
Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in YOUR_PATH\app\code\core\Mage\Core\Model\App.php on line 555 and defined in YOUR_PATH\app\code\core\Mage\Core\Model\Store.php on line 285
Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in YOUR_PATH\app\code\core\Mage\Core\Model\App.php on line 575 and defined in YOUR_PATH\app\code\core\Mage\Core\Model\Store\Group.php on line 227
Solution:
I had already written about this problem before. Have a look at this:-
The exact solution for this problem is present over here:-
The solution is to run the following MySQL query on your Magento database:
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;
After that, Refresh Cache (System -> Cache Management
).
That’s all. This should solve the error.
Hope this helps. Thanks.