We have recently designed a highly functional new online store for a client of ours using the advanced Magento shopping cart, taking eCommerce for this business to an entirely new level! We ran into a small snag during the initial stages of development as the client has a proprietary database system that stores detailed information for several hundred products. Their database software held everything from product name, pricing information, description. The client did not have the time to recreate all of the product information in the back-end of Magento using the built in tools. So, the challenge: How do we extract this information from their locally installed database information in a way that could be easily imported and put to work in Magento?
Fortunately, the database storing the client product details provides a mechanism to export product information to a CSV file. While it wasn’t pretty, the data was all there on the export. Sorting through 30 fields of data we didn’t need, we found fields for product name, model, color, asking price, category, and photo name. The trick now was figuring out how to map and then import this data into Magento.
The trick that helps you with a Magento import is knowing what’s absolutely necessary to import, and supplying that data in your own custom xls file. To do that, we added a product manually through the Magento interface. Here’s how:
- Click on catalog/manage products
- Click on Add Product
- Click through to enter a name, description, short description, sku, weight, status (enabled), and set visibility.
- Go to prices, enter a price, and tax class
- Click to the inventory area and set an initial quantity, then change stock availability to in stock
- Click to the category area and assign the new product to a category
Now save your product. If everything went according to plan, you will see your new product listed in your store under the selected category you selected previously. Great! Now that we have a functional product to work with, one that appears in the store, it’s time to export that data to a CSV file.
Exporting Magento items:
- Go to system, import/export, profiles from the admin panel
- Click on export all products
- The default values are fine, CSV/Tab Separated, attribute names, all fields
- Click on run profile to generate your CSV file
Now look in your Magento directory on your server, and find the var/export folder. The file export_all_products.csv will be on your server, download this to your local computer and open it in your favorite spreadsheet program (Excel works well!).
Now comes the tricky part. View export_all_products.csv side by side with a CSV of the data from your other database product. You are going to need to make the data from your previous database match the Magento data. I don’t want to tell you exactly how to do it, there are many different paths you can take to get to the same result. Find the fastest way that works for you. For me, it was as easy as deleting all of the columns from the old database CSV that weren’t used in Magento, renaming the column names to match similar columns in Magento, then creating columns that Magento needed that did NOT exist in the old data and pre-populating it with standard info. The fill function in Excel is extremely useful for this.
At the very least, you will want to make sure you have these columns:
- short description
Try to be as complete as possible, and include as many (if not all) of the fields from the original Magento export as you can in your new set of data to import. Leaving out something important could result in a botched import!
When you’re all finished and, depending on the size of data you’re dealing with, several minutes/hours/days/weeks later, you will have a new XLS file that you can save, ready for import to Magento. Go to System, Import, Profiles. Import all products. Be sure to increase the “number of records” to a higher value, like 3, if you’ve already modified and improved your Magento memory settings. I also like to import using the MS Excel XML (save to this format first) as it’s less prone to data errors caused by improper characters in the data stream. Save the file as XML Spreadsheet 2003, change the data type, then use the upload file tool to upload your XML file.
The process CAN take a long time, so be sure you leave the import window up during the process. With a little luck, all of your products have been imported! There is a way to do this while including images, but it gets a little complicated. With the method I’ve discussed, you will need to go in and manually upload images to each item. While that can be somewhat labor intensive, I like having Magento create proper names and file sizes for me for each product.