When you manage multiple store instances from Magento 2 sometimes you will need the specific store id of one store, especially if you would like to manipulate data by accessing the database directly.
One might ask why not use the methods provided by Magento2, the answer is simply they are way too slow to manage a store with over 1000 products effectively. Since we have 20K+ products it was necessary to change/manipulate data directly in the database across a huge, enterprise level,multi store environment.
So back to the original topic, the easiest way to find out your store id is
- Log in to the Magento2 backend
- Navigate to Stores->(Settings)->Configuration
- From the store selector menu ( Scope, upper left corner ) select the store you would like to see the store if for
- Have a look at the very end of the url in your browser and you will see something like: …/section/general/store/6/
- The number in that URL will tell you what is the store id for the shop you picked from the store selector menu.