Bobcares

Magento 2 Primary db_schema file doesn’t exist – Resolved

by | Jul 1, 2023

Learn more about the Magento 2 “Primary db_schema file doesn’t exist” error. Our Magento Support team is here to help you with your questions and concerns.

Magento 2 Primary db_schema file doesn’t exist – Resolved

If you have been coming across the following error message in Magento 2, you have come to the right place.

primary db_schema file doesn’t exist

Magento 2 Primary db_schema file doesn't exist - Resolved

According to our experts, this error usually occurs when Magento is not able to find the primary database schema file for a module during the setup upgrade process. In other words, this error lets us know that the XML file defining the module’s database schema is missing.

How to fix the error

  1. First, we have to check if the primary db_schema.xml file is present in the module’s directory. We can find the file at <module_dir>/etc/db_schema.xml. Our experts recommend verifying the file name is correctly spelled and that it exists in the correct location.
  2. Next, it is time to confirm that the module is correctly registered in Magento. We can find the module’s registration file at <module_dir>/registration.php.
  3. Then, we must check for any typos or incorrect module names in any of the files or configurations. We also have to double-check the module name used in the primary schema file and verify it matches the actual module name.
  4. At this point, we have to clear the Magento cache to ensure that any outdated or cached information is not behind the issue. We can clear the cache with this command:

    php bin/magento cache:clean

  5. Now, it is time to run the Magento setup upgrade command to recompile and update the database schema as seen below:

    php bin/magento setup:upgrade

After the above steps, we will no longer run into the “primary db_schema file doesn’t exist” error in Magento 2.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

In brief, our Support Techs demonstrated how to fix the Magento 2 primary db_schema file doesn’t exist error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.