When we connect magento 2.4 existing database to magento 2.4.6 and try to upgrade showing default website is not define please suggest me what I do in this case
Error showing like
In WebsiteRepository.php line 159:
The default website isn't defined. Set the website and try again.
2 Answers 2
Please check the table_prefix in app/etc/env.php
If prefix then remove it.
Another method
Run below script in database
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;
Take database backup befor run the script.
-
not work here still sameAashutosh Kumar– Aashutosh Kumar2023年06月12日 12:35:57 +00:00Commented Jun 12, 2023 at 12:35
In my case there is something problem under server then we setup my magento 2.4.3 file and database locally under my machine and upgrade working fine no issue has been seen like this type. so in this case server may be the cause of it.