Forums / Managing Customers and Orders / Need help importing customers database from csv file into mySQL

Need help importing customers database from csv file into mySQL

Locked
Results 1 to 19 of 19
This thread is locked. New replies are disabled.
28 Oct 2006, 13:41
#1
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Need help importing customers database from csv file into mySQL

Hi gang,

I'm just about ready to launch my new Zen Cart website and I exported all my customer's names, addresses, passwords and email addresses from my old website and Filemaker database. I've cleaned it up so only one of each email address is now in there and it's the latest one they placed on my old site. (sometimes they type it 2-3-4 times...duh)

I looked at the mySQL database and I see the tables
CUSTOMERS
and ADDRESS_BOOK (or similar name...too early for me this morning)


In the CUSTOMERS table, there is only a place for the name and email from my list and in the ADDRESS_BOOK I have all all the other stuff.

If I create a customer ID field in my exported (cleaned up) database, will this make it import correctly into mySQL and keep together?
Also, am I to assume that I CANNOT import the passwords they made in the older website? I have 3 customers in my new Zen Cart website now and when I view the password field in mySQL, they are all encripted.
If I try to import my list of old ones, will they even work?? Or (as stated in another post) will the returning customer(who will first hear about the new website from a bulk email) have to create a new password??


Here are the fields in my database that I would like to enter into the 2 tables of mySQL
I have almost 20,000 customers to import BTW.

eShopper_Email
Password
BillNameFirst
BillNameLast
BillCompany
BillAddress1
BillAddress2
BillCity
BillState
BillZip
BillPhoneDay
BillPhoneEve

I'll have to create that Customer ID field and populate it with a number before I import into Zen Cart... (I presume, so it has the same Customer ID in both the Customer and Address Book tables.... right?)


I also have 'ShipTo' fields, but I'll just leave them out instead to make it easier.


Any help or direction on the proper method of doing this will be greatly appreciated.

thanks,
Jeff Michaels
pres of Musical Creations Ltd.
28 Oct 2006, 15:25
#2
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Posts:
4,572
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

I would suggest you either pay someone to import your db or try using Easy Populate, available in the Downloads section -- I think. If not available a search of the Forums should find more info for you.
28 Oct 2006, 16:40
#3
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

I looked at Easy Populate just now and there is not import function for customers or address books.

I may try to get up the guts and try to import as I mentioned above by creating a customer ID in my database first.
Heck, I imported 23,000 items and 225,000 attributes for them the same way...raw mySQL importing and it works if you watch where you are at all times.

wish me luck!

Jeff
28 Oct 2006, 17:53
#4
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Posts:
4,572
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

Good Luck! :shocking:

You may find that after you get things the way you want, Easy Populate is the way to go. Being able to have everything in a Spreadsheet, for changing/adding mulitple new items, is definitely the way to go.
28 Oct 2006, 18:05
#5
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

there's just no import/export for customers in it...


Jeff
28 Oct 2006, 19:35
#6
pivey avatar

pivey

Zen Follower

Join Date:
Mar 2006
Posts:
192
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

Jeff, don't panic
Take your time and download the customer related fields from ZC as csv files to your local place.
Open them, see what they contain.

After that you will see that it is a piece of cake :laugh: to import thousands of them by assigning zen's table headers to your excel (or csv) index headers and to load the converted csv into your database.
Then check how zc handles the password encryption, might be that yours will be valid as well.

Make one customer import to check if it works.
28 Oct 2006, 19:58
#7
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

I uploaded it all a few moments ago, but the password encription doesn't work.
It just loads it what the passwords actually were, unencripted.


Unless you know of another way to keep those old passwords, I'll have to email everyone to log on have one sent to them and then they can change it if they want

thanks,
Jeff
28 Oct 2006, 20:12
#9
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

Thanks DrByte,

I will do that right now....
But do you know how to get around the customer password encryption so I can import they're actual 'old' passwords and it will allow them entry, without having to make a new one?

thanks
Jeff
28 Oct 2006, 20:47
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Need help importing customers database from csv file into mySQL

You'd have to write a PHP script to read the old password, encrypt it, and write it to the database. You could use the zen_encrypt_password() function within Zen Cart to do the encryption.
28 Oct 2006, 21:13
#11
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

OK Dr, this is getting quite deep and I am getting a bit lost on this.

If there an application that will just convert about 25000 passwords to MD5+salt?

thanks so much,

Jeff
28 Oct 2006, 23:18
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Need help importing customers database from csv file into mySQL

How's this?

Unzip to your /admin folder.
Then log into your admin
Then change the URL to call the filename.
Best to only run once.

It will convert all passwords less than 30 characters to MD5+salt using Zen Cart's built-in functions.

[Attachment removed]
29 Oct 2006, 00:15
#13
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

I got all the stuff working, but I can't convert even the first password.
It's happening at the Salt part (it looks like)
Here's the error message:

Converting all plain-text passwords less than 30 characters long to Zen Cart MD5+SALT format.
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':63 WHERE customers_id = 5094' at line 1
in:
[update customers set customers_password = 5265eddec1d5b0e4fbadca636c3c6a6f:63 WHERE customers_id = 5094]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.


I'll keep trying to find a way around it until I hear something back from you.

thanks so much for your help

Jeff
29 Oct 2006, 18:33
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Need help importing customers database from csv file into mySQL

Oops. Worked fine on smaller dataset for me. Missed some quotes. Update attached.
29 Oct 2006, 19:20
#15
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

WA HOOOO!!!


You's the DOCTOR alright!

This has saved me soooo much time, I can't begin to tell you.
I hope others can benefit from this little tool also.

Almost 23,000 imports and it worked perfectly.

(Hey, is there a tool that will decode one address too if someone calls in on the phone and needs help?)


I'M SENDING SOME COFFEE RIGHT NOW! You have really made my day...week..year etc.


thanks again,
Jeff Michaels
pres of Musical Creations Ltd.
29 Oct 2006, 20:41
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Need help importing customers database from csv file into mySQL

There's no decode option for the encrypted passwords.

However, there is a "master password" contribution that can be used to allow you to log in to the customer's account using your admin password ... see the "Encrypted Master Password" contribution for a very easy install.
29 Oct 2006, 20:45
#17
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Posts:
280
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

I'll give it a try.
Thanks....

There was another Paypal contribution by me today. http://www.zen-cart.com/donate
29 Oct 2006, 20:49
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Need help importing customers database from csv file into mySQL

jeffmic:

There was another Paypal contribution by me today.


Greatly appreciated !
20 Jan 2008, 15:54
#19
urasakik avatar

urasakik

New Zenner

Join Date:
Jan 2008
Posts:
1
Plugin Contributions:
0

Re: Need help importing customers database from csv file into mySQL

I also appreciate this support information and the tool.
This is great help to me.
Thank you. :clap::smile: