Magento Forum

Export all products (including categories, attributes & sets, prices, images) from Magento when export profiles doesn’t work? 
 
lookrad
Jr. Member
 
Total Posts:  1
Joined:  2012-11-20
 

I am migrating my client’s Magento install onto my local machine to do some serious housekeeping.

After attempting a mysql_dump of my client’s 3.3GB mysql db and coming up with multiple import errors on my local server, I decided to try exporting all the products (1250 of them) from the client’s Magento installation.  While attempting to export all products using an Export Profile, the export profile hung starting the execution script.  The file is never created.

I’m currently looking at using this script: XML Product Export - Very Fast - Bypasses Magento Code to create output all of the products, attributes, and other data into an XML file. 

<?php

    header 
("content-type: text/xml");
    
    
//Setup Connection information
    
$dbhost 'DB_HOST';
    
$dbuser 'DB_USER';
    
$dbpass 'DB_PASSWORD';
    
    
//Connect to the database
    
$conn mysql_connect($dbhost$dbuser$dbpass) or die('Error connecting to mysql');
    
    
//Point to specific DB
    
$dbname 'DB_NAME';
    
mysql_select_db($dbname);

    
//Create the Query to get the products
    
$sql "SELECT DISTINCT P.entity_id, P.sku, V.value AS Name, T1.value AS ProdDesc, T2.value AS ShortDesc,
    T5.value AS ModelMachine, D.value AS Price, CONCAT('http://www.yourdomain.com/', V1.value) AS Link, 
    CASE
        WHEN V2.Value IS NULL
            THEN NULL
        ELSE CONCAT('http://www.yourdomain.com/media/catalog/product', V2.value)
    END AS Image
    FROM  catalog_product_entity AS P INNER JOIN
    catalog_product_entity_varchar AS V  ON P.entity_id = V.entity_id  AND V.attribute_id  = 60  LEFT JOIN
    catalog_product_entity_varchar AS V1 ON P.entity_id = V1.entity_id AND V1.attribute_id = 87  LEFT JOIN
    catalog_product_entity_varchar AS V2 ON P.entity_id = V2.entity_id AND V2.attribute_id = 74  LEFT JOIN
    catalog_product_entity_text    AS T1 ON P.entity_id = T1.entity_id AND T1.attribute_id = 61  LEFT JOIN
    catalog_product_entity_text    AS T2 ON P.entity_id = T2.entity_id AND T2.attribute_id = 62  LEFT JOIN
    catalog_product_entity_text    AS T5 ON P.entity_id = T5.entity_id AND T5.attribute_id = 542 LEFT JOIN
    catalog_product_entity_decimal AS D  ON P.entity_id = D.entity_id  AND D.attribute_id  = 64"
;

    
//Run the query
    
$query mysql_query($sql);
    
    
//Begin the output
    
echo '<?xml version="1.0" encoding="ISO-8859-1"?>';
    echo 
'<catalog>';
    
    
//Loop through and print each products info
    
while($row mysql_fetch_array($query))
    

        
echo '<item>';
        echo 
'<entity_id>'.$row['entity_id'].'</entity_id>';
        echo 
'<sku>'.$row['sku'].'</sku>';
        echo 
'<name>'.$row['Name'].'</name>';
        echo 
'<description>'.$row['ProdDesc'].'</description>';
        echo 
'<shortdesc>'.$row['ShortDesc'].'</shortdesc>';
        echo 
'<modelmachine>'.$row['ModelMachine'].'</modelmachine>';
        echo 
'<price>'.$row['Price'].'</price>';
        echo 
'<link>'.$row['Link'].'</link>';
        echo 
'<image>'.$row['Image'].'</image>';
        echo 
'</item>';
    
}
    
    
//Finish output
    
echo '</catalog>';
?>

I haven’t run the script yet, or even saved it anywhere on my machine.  I’m wondering if there is a better way to do this, if I should just export individual tables from PHPmyAdmin or the console, or what.

I hope I’ve been relatively concise.

 
Magento Community Magento Community
Magento Community
Magento Community
 
AssociatedVOIP
Member
 
Total Posts:  44
Joined:  2012-01-28
 

That is a pretty hefty set of products.

What are the database import errors?
Are they to do with custom attributes?

Not sure what the best export method is, but for importing to the new database, I would suggest using Magmi.
It helps to optimize the database for that number of products.
sourceforge.net/projects/magmi/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Store_Manager
Enthusiast
 
Avatar
Total Posts:  867
Joined:  2012-07-09
 

Hello Lookrad!

There is the application called Store Manager for Magento. It is desktop application, so it does not require much time on installation on your server.
The software allows to export all the mentioned by you information - all product types with relations, product information, categories, attributes & sets, prices, images and also custom options. The thing it cannot export at the moment is superattributes, but as I know there is at the moment no tool to export them.

In case you are interested, you can download 14-day free version of Store Manager for Magento. It is fully functional and you can try it out.
Here is the link -
http://www.magentocommerce.com/magento-connect/store-manager-for-magento.html

Hope it will be useful.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top