title: Magento 1.4.1.1 -> 1.7 upgrade: foreign key constraint fails
body: <p>it seems updating magento is really hard :)</p>
  
  <p>I have magento 1.4.1.1 and i want to update it to the newest magento 1.4.2.</p>
  
  <p>I follow this guide:
  <a href="https://stackoverflow.com/questions/11662347/how-to-upgrade-magento-1-4-1-1-to-1-7-0-2">How to upgrade magento 1.4 1.1 to 1.7.0.2</a></p>
  
  <p>What i of course do:
  - Disable and clear cache
  - Clear sessions
  - Disable all extensions before update
  - Backup backup backup :D</p>
  
  <p>When i update from 1.4.1.1 to 1.4.2 i trigger the mainpage to make the mysql changes. This is where to problems start.</p>
  
  <p>I get this error:</p>
  
  <pre><code>a:5:{i:0;s:435:"Error in file: "/var/www/vhosts/dev/docs/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php" - SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`dev`.&lt;result 2 when explaining filename '#sql-20eb_3d66'&gt;, CONSTRAINT `FK_PRODUCT_ORDERED_AGGREGATED_MONTHLY_PRODUCT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entit)";i:1;s:974:"#0 /var/www/vhosts/dev/docs/app/code/core/Mage/Core/Model/Resource/Setup.php(390): Mage::exception('Mage_Core', 'Error in file: ...')
  </code></pre>
  
  <p>I have also tried to upgrade to 1.7 directly which leeds to numerous other similar errors. I of course could comment out all those pieces which cause problems but i dont think that would be wise :)</p>
  
  <p>Do you have any idea what i can do avoid / fix these errors?</p>
  
  <p>Thank you very much :)</p>
  
  <p>Greets</p>