2

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 .

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Jul 18, 2016 at 10:43

1 Answer 1

2

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;
answered Jul 18, 2016 at 10:58

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.