Zen Cart Logo
Forums / Managing Customers and Orders / Import Customers From CSV Via MySql?

Import Customers From CSV Via MySql?

Views: 2,653

Results 1 to 7 of 7
15 Jun 2011, 1:09 AM
#1
suntower avatar

suntower

New Zenner

Join Date:
Nov 2010
Posts:
68
Plugin Contributions:
0

Import Customers From CSV Via MySql?

Hi,

I have a CSV of customers from our current non-online system with the usual e-mail, name, address, etc. I'd like to import these into Zen Cart 1.3.9f.

I know how to import these directly into the db Zen_Customers using MySQL, but I don't know how to handle the Password column. Since the customers don't -have- a 'password', there's no reason why I couldn't use a dummy field if I knew what to use.

  1. Is it OK to import directly as I've described? If not, can you recommend how to do this?

  2. If it -is- OK to import, can I simply copy the same scrambled pw column from a known dummy customer or should I leave it blank... or null?

  3. Any other tips/traps to doing this?

TIA,

---JC

15 Jun 2011, 1:19 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Import Customers From CSV Via MySql?

TRAP:

As each customer is assigned a customer ID which is an auto incremented value you will need to take care in doing this so that your ID's remain unique and not the value you currently have in your csv which may already belong to another customer

It might be better to to install the news letter subscribe 3rd party module that only records as I recall the email address
You could then email all these individuals as a reminder that their email address is in the DB and if they were to create an account using that email they only need to enter a password plus the other details

Or if you have many, a better option is to start using one of the mass email services....one is mail chimp that is now allowing 2,000 addresses at no cost to you
You then have access to professional looking email templates and you will also appear more professional

15 Jun 2011, 1:46 AM
#3
suntower avatar

suntower

New Zenner

Join Date:
Nov 2010
Posts:
68
Plugin Contributions:
0

Re: Import Customers From CSV Via MySql?

Thanks.

Both are good suggestions!

---JC

kobra:

TRAP:

As each customer is assigned a customer ID which is an auto incremented value you will need to take care in doing this so that your ID's remain unique and not the value you currently have in your csv which may already belong to another customer

It might be better to to install the news letter subscribe 3rd party module that only records as I recall the email address
You could then email all these individuals as a reminder that their email address is in the DB and if they were to create an account using that email they only need to enter a password plus the other details

Or if you have many, a better option is to start using one of the mass email services....one is mail chimp that is now allowing 2,000 addresses at no cost to you
You then have access to professional looking email templates and you will also appear more professional

15 Jun 2011, 3:32 AM
#4
suntower avatar

suntower

New Zenner

Join Date:
Nov 2010
Posts:
68
Plugin Contributions:
0

Re: Import Customers From CSV Via MySql?

I checked out MailChimp, but before I go down that road, are there any advantages to Newsletter Subscribe? It seems like I can get a pretty decent HTML newsletter (adequate for our purposes, in any case) in the built-in Zen Cart Newsletter Editor. I like the apparent integration between Newsletter Subscribe and Zen Cart.

Just trying to decide before I spend a lot of time on either solution. It seems like either might be OK so I'm looking for more pluses/minuses.

Thanks Again---This is -really- good!

---JC

15 Jun 2011, 3:47 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Import Customers From CSV Via MySql?

  1. The newsletter-subscribe addon is a BEAR to install, and touches TONS of core files, making upgrades a ROYAL PAIN IN THE REAR. I strongly recommend avoiding it unless you want lots of work later.
    Much better to use an external system if you've got a lot of addresses for non-customers. kobra has suggested one. There are others, such as those suggested on the Recommended Services link at the top of this page.

  2. If you do decide to import data blindly into your store (not recommended), keep the following in mind:
    a) DO NOT assign a password to those records. Better to leave them blank and have them use the Forgot My Password option to get a new one, otherwise you'll be giving everyone the SAME password, which is a huge security problem.
    b) You MUST NOT import only to the "customers" table. A customer record consists of data in three tables: customers, customers_info, address_book. If you don't enter in all of them, and if you don't cross-reference them to each other, then you'll end up with confused data, and lots of errors in your admin when accessing those records, and those customers will have difficulty using checkout. In short, it's not recommended to be blindly importing a CSV into the customers table. It's more complicated than that.

15 Jun 2011, 5:38 AM
#6
suntower avatar

suntower

New Zenner

Join Date:
Nov 2010
Posts:
68
Plugin Contributions:
0

Re: Import Customers From CSV Via MySql?

DrByte:

  1. The newsletter-subscribe addon is a BEAR to install, and touches TONS of core files, making upgrades a ROYAL PAIN IN THE REAR. I strongly recommend avoiding it unless you want lots of work later.

I was wondering about it for this reason alone. I come from a Drupal/Wordpress background and the thing that makes me cringe about platforms like ZenCart and PhpBB are how so many add-ons seem to be rely on doing 'mods' to core files.

DrByte:

  1. If you do decide to import data blindly into your store (not recommended), keep the following in mind:
    a) DO NOT assign a password to those records. Better to leave them blank and have them use the Forgot My Password option to get a new one, otherwise you'll be giving everyone the SAME password, which is a huge security problem.
    b) You MUST NOT import only to the "customers" table. A customer record consists of data in three tables: customers, customers_info, address_book. If you don't enter in all of them, and if you don't cross-reference them to each other, then you'll end up with confused data, and lots of errors in your admin when accessing those records, and those customers will have difficulty using checkout. In short, it's not recommended to be blindly importing a CSV into the customers table. It's more complicated than that.

Thanks. I had no intention of doing this blindly... which is why I asked first. And thank -you- for the quick and thorough reply.

FOLLOW UP: Is there data model or other documentation on the zen cart db? I haven't seen any docs which describe this. Maybe I'm blind, but I think that would help me a lot.

Again, THANKS!

---JC

15 Jun 2011, 5:54 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Import Customers From CSV Via MySql?

suntower:

Is there data model or other documentation on the zen cart db? I haven't seen any docs which describe this. Maybe I'm blind, but I think that would help me a lot.

Again, THANKS!

http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema