I had migrated data into magento 1.X to 2.X.
In the migrated website I have around 2000 pages+blocks so I have to set all CMS blocks and CMS pages in all stores.
Give me a better solution .
The relation between blocks and store view is kept in the table cms_block_store
and for pages in cms_page_store
.
These tables contain 2 column. One is the store_id
and the other is the page or block id, depending on the table.
You can simply insert rows in these tables.
One row for each page and block and set the store id to 0.
This will make all pages and blocks available in all the stores.
You can run these queries on your db:
For blocks
INSERT INTO cms_block_store
SELECT block_id, 0 FROM cms_block;
and for pages
INSERT INTO cms_page_store
SELECT page_id, 0 FROM cms_page;