{"id":1441,"date":"2020-12-08T05:32:38","date_gmt":"2020-12-08T05:32:38","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/solved-inventory-stock-1-doesnt-exist-in-magento-2\/"},"modified":"2025-07-17T10:18:29","modified_gmt":"2025-07-17T04:48:29","slug":"solved-inventory-stock-1-doesnt-exist-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solved-inventory-stock-1-doesnt-exist-in-magento-2\/","title":{"rendered":"Solved: inventory_stock_1 Doesn&#8217;t Exist in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2\u00a0is widely used CMS to create online stores. Owing to its flexibility of customization, the platform is suitable for modern business requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, sometimes the developers are stuck with errors while developing custom functionalities or performing any operations on the Magento 2 store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today, I\u2019ll talk about one such error that says,<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>inventory_stock_1 Doesn\u2019t Exist<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The inventory_stock_1 Doesn\u2019t Exist error occurs while importing database in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you are&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/move-magento-2-from-localhost-to-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">moving Magento 2 from localhost to server<\/a>&nbsp;for which you need to import database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The solution to&nbsp;<em><strong>inventory_stock_1 Doesn\u2019t Exist in Magento 2&nbsp;<\/strong><\/em>is the SQL query given below for you to refer:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution to the error \u201cinventory_stock_1 Doesn\u2019t Exist\u201d in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run the below SQL query:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE\nOR REPLACE\nVIEW `inventory_stock_1` AS select\n    distinct `legacy_stock_status`.`product_id` AS `product_id`,\n    `legacy_stock_status`.`website_id` AS `website_id`,\n    `legacy_stock_status`.`stock_id` AS `stock_id`,\n    `legacy_stock_status`.`qty` AS `quantity`,\n    `legacy_stock_status`.`stock_status` AS `is_salable`,\n    `product`.`sku` AS `sku`\nfrom\n    ( `cataloginventory_stock_status` `legacy_stock_status`\njoin `catalog_product_entity` `product` on\n        (( `legacy_stock_status`.`product_id` = `product`.`entity_id` )));<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, do share the solution with Magento developers via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2\u00a0is widely used CMS to create online stores. Owing to its flexibility of customization, the platform is suitable for modern business requirements. However, sometimes&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1441","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1441"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1441\/revisions"}],"predecessor-version":[{"id":14586,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1441\/revisions\/14586"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}