This extension can Import/Export products and customers from/to CSV file. Create categories, add attribute options, import images and media galleries, reindex, refresh cache, media and price rules automatically. In addition you can backup the entire database in SQL format
Imports:
(products, customers)
file.csv: multiple-row csv files, supports multiselect fields
(products)
file.csv1: single-row csv files, supports multiselect and multivalued fields
Multivalued fields:
Only with CSV1 files, these fields are automatically processed as multivalued:
_store
visibility
_category
_associated_sku
_media_image
_media_attribute_id
_media_label
_media_position
_media_is_disabled
To define your own ones, use * (this overrides default values)
sku ,*_category ,*_associated_sku
TEST,"CAT1/CAT2,CAT3","ASSOCIATED1,ASSOCIATED2"
Multiselect fields:
Use commas to separate values, but make sure not to put asterisks in column header, ie:
sku ,*_category ,color
TEST,"CAT1/CAT2,CAT3","red,yellow"
Exports:
(products, customers)
file.csv: multiple-row new csv files (no support for multiselect)
(database)
backup all tables to SQL gz-compressed file
OPTIONS
-h
-help
print this usage and exit
-a
-all
same as -c -f -p -r options
-b
-behavior
set import behavior for csv file: append|delete|replace (default)
-c
-cleancache
clean cache storage (html output, etc)
-ce [file]
-customersexport [file]
output customers to csv file, if output file not specified uses defined in config.xml
-ci [file]
-customersimport [file]
import customers from csv file, if source file not specified or not found uses defined in config.xml
-db [file]
-databasebackup [file]
output whole magento database to sql file and try to gzcompress it, if output file not specified uses time generated name
-deleteallcustomers
delete all customers (NOT from csv, entire magento database!)
-deleteallproducts
delete all products and non-root categories (NOT from csv, entire magento database!)
-e [file]
-export [file]
output products to csv file, if output file not specified uses defined in config.xml
-i [file]
-import [file]
import products from csv or csv1 file, if source file not specified or not found uses defined in config.xml.
-f
-flushimages
flush catalog images cache
-l
-linecount
split import file into pieces of n lines length ($tmp_folder must be writable)
-p
-applyrules
recalculate catalog price rules
-r
-reindex
reindex data by all indexers (attributes, prices, etc)
EXAMPLES
import
php -f amartinez_customimportexport.php -- -all -import var/customimportexport/test_single_row_style.csv1
export
php -f amartinez_customimportexport.php -- -e
reindex
php -f amartinez_customimportexport.php -- -a
backup, import, reindex
php -f amartinez_customimportexport.php -- -databasebackup -import -all
CRONTAB EXAMPLES
# do tasks and send results by email
00 03 * * * root php -f /magento_base_dir/amartinez_customimportexport.php -- -db -a -i /magento_base_dir/var/customimportexport/products.csv1 2>&1 | xargs -0 -I msg echo -e "Subject: MY STORE products daily update \\n\\n " msg | /usr/sbin/sendmail -f some@address.com some@address.com
# do tasks, append output to log file and send last results by email
00 05 * * * root php -f /magento_base_dir/amartinez_customimportexport.php -- -db -a -i /magento_base_dir/var/customimportexport/products.csv1 2>&1 | tee -a /var/log/amartinez_customimportexport.log | echo -e "Subject: MY STORE products daily update \\n\\n `cat`" | /usr/sbin/sendmail -f some@address.com foo@address.com,bar@address.com
CREDITS
I would be delighted to hear from you if you like this script. I also appreciate any donation you wish to contribute to the growth of this project (paypal: toniyecla [at] gmail [dot] com).
Releases (12)
Date | Version | Notes |
---|---|---|
2011-07-07 | 1.5.014 | Magento 1.5+ version. |
2011-06-29 | 1.5.013 | Magento 1.5 version. |
2011-05-24 | 1.5.011 | Magento 1.5 version. |
2011-05-18 | 1.5.010 | Magento 1.5 version. |
2011-05-12 | 1.5.009 | Magento 1.5 version. |
2011-05-11 | 1.5.008 | Magento 1.5 version. |
2011-05-08 | 1.5.007 | Magento 1.5 version. |
2011-05-05 | 1.5.005 | Magento 1.5 version. |
2011-04-28 | 1.5.004 | Magento 1.5 version. Please use UTF-8 csv files (to convert from any charset please use iconv linux command) |
2011-04-28 | 1.5.003 | Magento 1.5 version. Please use UTF-8 csv files (to convert from any charset please use iconv linux command) |
2011-04-27 | 1.5.002 | Magento 1.5 version. Please use UTF-8 csv files (to convert from any charset please use iconv linux command) |
2011-04-26 | 1.5.001 | Magento 1.5 version. Please use UTF-8 csv files (to convert from any charset please use iconv linux command) |