mysql - Magento 1.7 How To Delete Existing Superfluous Websites and Stores -


on large magento project working on (inherited previous agency) installation has 41 stores across 18 websites.

the site has 40k products , 5k categories - can imagine db bloated beyond belief.

i remove 2 websites , 2 store views (one per website), using gui fails - on deleting store views page goes blank. although db remove store core_store table, feels flaky. cannot remove default store view website - when website(s) in question not default installation.

trying delete website gives 'can not delete website @ time, please try later'.

is there clean, safe way remove superfluous store, parent websites , data associated them db directly?

thank you.

i'm facing same task myself, on legacy system inherited. process removing actual store simple -- go database , delete row core_website. trigger cascading delete wipes out corresponding records in core_store , store_group, triggering cascading deletion of store/website scoped eav values, , variety of other things. can find full list running query (substitute db name in place of your_magento_database):

select table_name    referential_constraints   constraint_schema = 'your_magento_database'         , referenced_table_name in( 'core_store', 'core_website' )         , delete_rule = 'cascade'  

steve robbins mentioned after deleting these things, end lots of "orphaned" records aren't removed cascading deletion. below list of things have been going through (mostly manually) clean up, following removal of website/store.

  • customer groups (each customer group gets own price index; causes huge database bloat)
  • products

    delete catalog_product_entity entity_id not in (select product_id catalog_product_website);

  • categories
  • catalog rules

    delete catalogrule rule_id not in (select distinct rule_id catalogrule_website);

  • shopping cart price rules

    delete salesrule (rule_id not in (select distinct rule_id salesrule_website));

  • config data (looks magento 1.9 deleted these automagically, here's query confirm)

    select * core_config_data (scope="stores" , scope_id not in (select store_id core_store)) or (scope="websites" , scope_id not in (select website_id core_website));)

  • cms pages

    delete cms_page page_id not in (select distinct page_id cms_page_store);

  • static blocks

    delete cms_block block_id not in (select distinct block_id cms_block_store);

  • widget instances
  • flat category/product tables
  • email templates
  • tax rules, tax class, tax rate
  • admin users, admin roles
  • api users

i hope serve useful information else doing multi-store cleanup. plan on updating answer find more efficient ways of doing cleanup.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -