0

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

1

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.

Ref link: Magento 2 - Moving site - 'No such entity'

1
  • not work here still same Commented Jun 12, 2023 at 12:35
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.