Free Product and Category CSV Export for Magento 2
This free, open-source script exports product data in CSV format from any Magento store. It is specially designed to support very large stores (millions of SKUs). Unlike typical modules or extensions, this is a read-only, standalone script that requires zero changes to your Magento installation. This script can be used stand-alone, or with our Magento Google Shopping Feed Service.
New Features! (April 2020)
- Support for Magento Commerce (Enterprise) Catalog Staging Module (exports current version)
- Separate Category CSV export (all attributes)
- Removed dependencies on flat tables and index tables
- ~25% faster performance
- Improved user interface (one-click copy export URL to clipboard)
- Paging support with SinceEntityId URL parameter and records_per_request config setting
- Export any table in your Magento database (disabled by default for security)
More Key Features
- Support for Magento 2.x all versions and editions,
including Magento Open Source and Magento Commerce
(previously known as Community and Enterprise)
with full backward-compatibility to all Magento 1.x versions
- Export exchange rates and shipping rates (contact us for details)
- Improved security and PCI-compliance
This is a standalone script that makes zero changes to your Magento installation files or database. To install, just copy the two scripts to your website. To uninstall, just delete the two scripts.
Change/Upgrade Log (Incompatible Changes)
- Beginning with version 2020-04-16
json_categories format has changed. It now contains a simple array of full category names
that apply to the item, e.g. ["Default Category > Clothing > T-Shirts","Default Category > Specials"].
Added 'records_per_request' => 2147483647 to the config file.
Dropped flat_url_key and flat_url_path fields
- Beginning with version 2017-06-17
- The password is saved encrypted in a separate configuration file. To upgrade, you can simply overwrite the previous code file and keep the configuration file.
About the Product Export Code for Magento
The product data exporter code consists of a single file that you install in your website. This will create a page on your website from which you can download all the product data from your store.
The software lets you choose your Magento website, and then it exports the product data in CSV format.
The software is provided open-source and free, licensed under GPL. The exported CSV file can be imported by our Magento Google Shopping Feed Service, giving you the ability to generate data feeds and get listed in all the major comparison shopping engines (Google Shopping, Bing Shopping, Facebook, Connexity, etc.).
The code accepts URL query string parameters to generate the output. 'Command' must be set to 'Export' and 'Password' must be set to the password stored in the configuration file. 'Store' must be set to a valid Store ID. The script is designed to disallow a blank password. The final URL will look like the following, where bold parts should be customized to your store:
http://www.mystore.com/aten_exporter_for_magento.php? ⏎ Command=Export&Store=1&Password=ABCDEFG
By default, out-of-stock items are included in the export and disabled items are excluded. The script supports the following export options to override this behavior:
- Exclude out-of-stock products (stock_status=0)
- Include disabled products (status=0)
- Compatible with all versions of Magento: 1.0, 1.1, 1.2, 1.3, 1.4, 22.214.171.124, 1.4.2, 1.5, 1.6, 1.6.1, 126.96.36.199, 1.7, 1.8, 1.8.1, 1.9, 2.0, 2.1, 2.2, 2.3, and up
- Compatible with both Magento Open Source (Community Edition - CE) and Magento Commerce (Enterprise Edition - EE).
- Compatible with Catalog Staging Module
- This is an extremely high-performance script carefully designed to run on the largest stores with minimal resource usage. If some information is not being exported by this script, please let us know.
- The output is compressed to save bandwidth, if supported by the browser.
- The output is encoded in UTF-8. Use OpenOffice or LibreOffice Calc if your version of Excel does not support UTF-8.
By default, paging is turned off, so the script will export all your items. This works fine up to around 250,000 SKUs. After that, it may be difficult to get a reliable export due to the length of time the script runs, which may run into web server timeouts and security policies.
Paging is only supported for the product export, not the category export.
The script returns products sorted by entity_id (ascending), where entity_id > SinceEntityId, and limited to records_per_request products. To enable paging, follow these steps:
- Edit the config file and set records_per_request to an appropriate number, e.g. 50,000 or 100,000.
- In the query string, append
&SinceEntityId=0. This will return the first page of results.
- Import the CSV file and read the maximum (or last) entity_id
- To retrieve the next page, modify the query string so it has
&SinceEntityId=NNNN, where NNNN is the last entity_id from the previous file.
- Repeat until you get a response with no content, i.e. zero bytes, not even a header line.
Direct Download Links
Click on aten_exporter_for_magento.php to view the code directly.
Click on aten_exporter_for_magento_config.php to view a sample config file. The sample config file will not work unless an SHA-256 hashed password is specified.
Command Line Fetch
- Install the exporter script into your Magento website directory as described above.
- Run the following command:
wget --output-document=export.csv 'http://www.store.com/aten_exporter_for_magento.php?Command=Export&Store=1&Password=ABCDEFG'
- Be sure to set the output file name, website URL, store ID, and password to your configuration.
- For Windows, use double-quotes instead of single-quotes.
Command Line Direct Execution
The script can be run directly from the command line, and will output a CSV document to your console.
cdto the folder that contains the script
- Run the following:
php aten_exporter_for_magento.php 'Command=Export&Store=1&Password=ABCDEFG' > export.csv
To uninstall, just delete the exporter script and config file. There are no other steps.
cdto the folder that contains the script
- That's it!