Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Customers To Magento via csv

Tags:

magento

I'm trying to import customers into magento with a csv file, using Magento built in customer importer.

It's working OK (customers name, email and password goes into database), but the customers billing and shipping addresses are not.

Here's my csv header:

'id', '_website', 'firstname', 'lastname', 'email', 'password_hash',   'billing_firstname', 'billing_lastname', 'billing_company', 'billing_postcode', 'billing_city', 'billing_street1', 'billing_telephone', 'billing_country', 'billing_region', 'shipping_firstname', 'shipping_lastname', 'shipping_company', 'shipping_postcode', 'shipping_city', 'shipping_street1', 'shipping_telephone', 'shipping_country', 'shipping_region', 'is_subscribed', 'group_id', 'dob'

I also tried to put these tags into header, but still nothing.

'postcode', 'city', 'street1', 'telephone', 'country', 'region',

If anyone had this problem and know how to do this, please help,

Thanks in advance,

like image 624
user1999634 Avatar asked Feb 08 '13 13:02

user1999634


2 Answers

OK, I found a solution to do this:

Go to Magento admin->System->Import/Export->Dataflow profiles. (NOT to Magento admin->System->Import/Export->Import!)

Then, select profile: Import Customers (or create if it not exists).

I set the Store value in Profile information box to 'Default store view'. Then, upload Your csv, and run the profile.

It worked for me and goes every value into magento database correctly - shipping and billing addresses too.

Here is my CSV header:

id  website firstname   lastname    email   password_hash   billing_firstname   billing_lastname    billing_company billing_postcode    billing_city    billing_street1 billing_telephone   billing_country billing_region  shipping_firstname  shipping_lastname   shipping_company    shipping_postcode   shipping_city   shipping_street1    shipping_telephone  shipping_country    shipping_region is_subscribed   group   group_id    dob

I don't know if group_id is required or not, but you must have a group column (I set 'General' value for it.)

I found it a little buggy, so don't panic if everything are set correct and You get an error message like: 'required column website not set' - or similar, I refreshed the Import Dataflow page, run the profile again, and it worked - of course You set everything correctly.

Hope it helps,

like image 130
user1999634 Avatar answered Sep 25 '22 01:09

user1999634


The "Group_id" is going to cause a problem. The correct header is group. ( I have seen some examples of select statements that are using "Group_id" and I believe they do not know how to escape reserved words in MYSQL.

If you put the default value of General in the Group column the import should be OK

like image 44
Don Myers Avatar answered Sep 27 '22 01:09

Don Myers