I need to export a CSV file with all the product weights on it, i tried to do it in the back end but i get this error

Request Timeout

This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

Is there a way i can do this via SSH or through a script?

Thank you


3 Answers 3


Please try this:

In Magento Admin Panel

Go to System -> Import/Export -> Dataflow Profiles -> Export All Products

There you should be able to customize which attributes to export

It will by default export to /var/export

Please let me know if this works for you

  • I had to do it this way and just export it in small chunks as we have to many products. Also had to get my server provider to up my connection time to the max
    – Adam Allen
    Oct 20, 2014 at 8:57

You can do it by using Dataflow Profiles itself as others said. Or in another way you can use the following script to export the weight with sku.

require_once 'app/Mage.php';
$iteration = 0;
$saveData = array();
header('Content-type: application/utf-8');
header('Content-disposition: attachment; filename="exportweights.csv"');
$fp = fopen('php://output', 'w'); 
$products = Mage::getModel('catalog/product')->getCollection();
foreach ($products as $product) {
$_product = Mage::getModel('catalog/product')->load($product->getId());
$saveData['sku'] = $_product->getSku();
$saveData['weight'] = $_product->getWeight();//Configurable product will return empty  
if($iteration==0) fputcsv($fp, array_keys($saveData));
fputcsv($fp, $saveData);

Note: CSV file will get downloaded to your PC.


Just raise the max_execution_time of php. Either via ini_set() or .htaccess

You could do it in the apache configuration too, but you want to restore the setting.

  • tried adjusting the .htaccess but it still timed out
    – Adam Allen
    Oct 17, 2014 at 11:18
  • read the link I posted aboce and check the logs. Oct 17, 2014 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.