title: Magento 1.7 How To Delete Existing Superfluous Websites and Stores
body: <p>On a large Magento project I am working on (inherited from a previous agency) the installation has 41 stores across 18 websites.  </p>
  
  <p>The site has 40k products and 5k categories - so as you can imagine the db is bloated beyond belief.  </p>
  
  <p>I would like to remove all but 2 websites and 2 store views (one per website), but using the GUI fails - on deleting store views the page goes blank.  Although the db does remove the store from the core_store table, it feels flaky.  I also cannot remove the default store view for its website - even when the website(s) in question are not the default for the installation. </p>
  
  <p>Trying to delete a website gives a 'can not delete the website at this time, please try later'. </p>
  
  <p>Is there a clean, safe way to remove all the superfluous store, their parent websites and all the data associated with them from the db directly?</p>
  
  <p>Thank you.</p>