I have installed magento 2 into my Personal Computer. It working fine over there.
I have installed same copy at another system then frontend is working fine admin is not. (its showing 404 page)
Right now I want to install it into my laptop.
I did following…
-
I just copy magento2 folder from my PC i.e
wamp/www/magento2
and put it at proper destination into laptop i.ewamp/www/magento2
-
I export magento2 database from PC and import at Laptop localhost.
-
Update the
base_url
into imported DB. -
Deleted contents unders
var/
as wel aspub/static/
I tried following…
- run
php magento setup:upgrade
but not useful.
Best Answer
This is a general error, usually occurs when you transfer your magento-2 installation from one location to another. The reason behind this error is that the value
store_id
andwebsite_id
for the admin should be0
, but when you import the database to a new server, somehow these values are not set to0
.So to solve this error you will need to make some changes in the database tables itself.
SET FOREIGN_KEY_CHECKS=0; UPDATE store SET store_id = 0 WHERE code='admin'; UPDATE store_group SET group_id = 0 WHERE name='Default'; UPDATE store_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;