How to add/edit/remove products using the import/export tool
The import/export tool is very useful within magento. Being that there is limited documentation on the topic, I thought I would add my .02.
Basically you can use the import/export tool to do mass imports of products. It makes it much easier if you would like to add 50 products all at once, you would just create a csv or xml file with the matching fields for the database, add your information and then use the import tool to import the products. You can retrieve a sample csv or xml file, by doing an export.
Doing an export is very easy, and allows you to export all of your products out of your website. You might want to do this, if you are moving your website or need to reinstall or upgrade your website, and need to get the products out.
In the Magento Admin, go to System > Import/Export > Profiles. The name may seem a little confusing at first, but once you realize you can import/export everything, you see why there’s nothing like “Export products” in the menu.
Something you might want to do is export the products that were added on a development server to an actual production server (or vice-versa). Luckily, a profile for exactly that is present in the standard install of Magento, and it’s called Export all products. Click on Edit to open it.
Two things that are important are the Filename and the Path, because this tells you where Magento saves the .csv file. If Excel (or another spreadsheet editor) uses a different delimiter character, you can also set this in Data Format.
After you’ve checked everything in the Profile Wizard, go to Run Profile. Click the “Run profile in pop-up” button and wait. Magento now starts the procedure, and in the meantime you can open your FTP client and navigate to the folder (the folder for this profile is /var/export). You’ll see a CSV file appear; when Magento is finished, download the CSV file to your computer.
In the default installation, there’s also a profile called “Import all products”. To get there, just go to System > Import/Export > Profiles. Click “Edit” for the profile called “Import all products” (again, this should be present in the default install).
Go to the Upload File tab and select the CSV file you’ve downloaded from the FTP after exporting. Make sure you have the right one - if they don’t match, you’ll get errors.
Click Save and Continue Editing. This uploads the CSV file. Then, go to the Run Profile tab, choose the CSV file in the dropdown and click “Run Profile in pop-up”.
The import procedure can create or update existing products. The update requires just the “sku” field and the other fields that are going to be changed.
Note: If product attribute exists in the system, but value for it does not present in a product row of .csv file, and attribute type is kind of option(i.e. dropdown, multiple select, etc) following rules will be used:
- In case when default value is specified for such attribute in system - product row should be imported with assigning default value for that attribute
- In case when default value is not specified for that attribute - product row should not be imported into the system
The creation of new products requires more fields:
- type (Ex: “simple”)
- attribute_set (”Default” or another field set name)
- tax_class_id (”None” or another tax class name)
- status (”Enabled”)
- weight (yes, it is required... just put “1” if you don’t use it)
- sku (unique product identification)
Furthermore the new created products can’t appear in your store if you miss some of “non-required” fields like
- visibility (”Catalogue,Search”)
- category_ids (At the moment these have to be the internal category ids... not easy to discover, try exporting some products to see them. You can find them in your db table = catalog_category_entity_varchar, field = entity_id.)
- qty (required to show your products if you enabled the stock control in the administration area)
- image, small_image, thumbnail if you put the image in media/import. Enter the image file name prepended with a slash. You can use the same image, a large image and Magento will scale it to size for the other images.