title: Magento: Bulk change product store id
body: <p>I've just imported ~800 products into Magento before realising I had store_id set to 0 when it should have been 1. </p>
  
  <p>Does anyone know an easy way to update this? I've tried changing the store_id to 1 in the spreadsheet and importing it again to update them but it hasn't worked.</p>
  
  <p>I found this SQL at <a href="http://www.magentocommerce.com/boards/viewthread/1798/" rel="nofollow">http://www.magentocommerce.com/boards/viewthread/1798/</a> but I'm getting syntax errors and unknown column errors so I've not gone any further with it.</p>
  
  <pre><code>REPLACE INTO catalog_product_store (store_id, product_id) SELECT 1,entity_id from catalog_product_entity
  update catalog_category_entity set store_id = 1 where store_id = 0;
  update catalog_product_entity set store_id = 1 where store_id = 0;
  update catalog_product_entity_datetime set store_id = 1 where store_id = 0;
  update catalog_product_entity_decimal set store_id = 1 where store_id = 0;
  update catalog_product_entity_gallery set store_id = 1 where store_id = 0;
  update catalog_product_entity_int set store_id = 1 where store_id = 0;
  update catalog_product_entity_text set store_id = 1 where store_id = 0;
  update catalog_product_entity_tier_price set store_id = 1 where store_id = 0;
  update catalog_product_entity_varchar set store_id = 1 where store_id = 0;
  </code></pre>