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.

asked Jun 12, 2023 at 12:00

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'

answered Jun 12, 2023 at 12:08
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.

answered Jun 16, 2023 at 6:27

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.