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.
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.
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.
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.
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.
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.
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
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?
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.
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.
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.