Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 3 of 3
Import customers with md5 password
 
videohead
Jr. Member
 
Total Posts:  22
Joined:  2010-10-14
 

Importing users using the Import Users function in admin does not MD5 has the passwords from plaintext, so you will need to add a MD5 function.
I’m just going to end up doing an UPDATE query, I think to fix, since I just imported 18292 users.
I’ll post back to the forums when I get a working UPDATE query. The data for password is stored in mage_customer_entity_varchar as attribute_id 12

 
Magento Community Magento Community
Magento Community
Magento Community
 
cdcaveman
Jr. Member
 
Total Posts:  18
Joined:  2010-09-28
 
Saggy - 23 July 2009 05:16 AM

If you have plain text password then goto this class Mage_Customer_Model_Convert_Adapter_Customer and replace

$customer->setPasswordHash($customer->hashPassword($customer->generatePassword(8)));

with

$customer->setPasswordHash($customer->hashPassword($importData['pass_new']));

N.B. pass_new will be the column where you will put your plain text password

This class can be overwritten if required. But if not then revert back the change after successful import

ok so , will the values then be converted once this rule is reverted back to the use of hashpassword???  i’m confused as to what exactly to do
i have plain text passwords… whats the best way to import them directly in.. and not worry about bugs later??

will using this rule cause a conflict later once reverted back?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Saggy
Sr. Member
 
Total Posts:  133
Joined:  2009-02-03
 

If you are doing one off import then you can use this trick. And passwords will automatically be converted to encrypted format.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lgdesigner
Sr. Member
 
Avatar
Total Posts:  102
Joined:  2010-09-14
 

If you have plain text password then goto this class Mage_Customer_Model_Convert_Adapter_Customer and replace

$customer->setPasswordHash($customer->hashPassword($customer->generatePassword(8)));

with

$customer->setPasswordHash($customer->hashPassword($importData['pass_new']));

N.B. pass_new will be the column where you will put your plain text password

This class can be overwritten if required. But if not then revert back the change after successful import

Hi Saggy,

I followed their advice. replacing the class Mage_Customer_Model_Convert_Adapter_Customer in the file Customer.php

$customer->setPasswordHash($customer->hashPassword($customer->generatePassword(8)));

with

$customer->setPasswordHash($customer->hashPassword($importData['pass_new']));

I added a new column in my file “pass_new” import_customer.csv example:

email,_website,_store,confirmation,created_at,created_in,dob,firstname,gender,group_id,lastname,middlename,password_hash,prefix,store_id,suffix,taxvat,website_id,pass_new,_address_city,_address_company,_address_country_id,_address_fax,_address_firstname,_address_lastname,_address_middlename,_address_postcode,_address_prefix,_address_region,_address_street,_address_suffix,_address_telephone,_address_default_billing_,_address_default_shipping_

"leonardo@test.com.br","base","default","","2011-03-28 18:55:05","Default Store View","","Leonardo","Male","1","Garcia","","","","1","","","1","test123","São Gonçalo","webdesigner","BR","12345","Leonardo","Garcia","","24430650","","Rio de Janeiro","Roberto Stevenson, Gradim","","219999999","1","1"

From what I understand the file Customer.php it will only create a new password is if the column is blank in password_hash import_custormer.csv ok?!

My question is this?

In column pass_new import_customer.csv I put in the password “test123” or password that is in the field attribute_id = 12 database table customer_address_entity_varchar ``??

I was tested here using the example above and the table does not save your password.

Is anyone experiencing this same problem when importing customers from version 1.4.1.1 to 1.5.0.1

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
igrossiter
Jr. Member
 
Avatar
Total Posts:  14
Joined:  2008-04-14
 

If you have plain text passwo(...)stomers from version 1.4.1.1 to 1.5.0.1

Thanks!

Hi Leonardo,

Have you managed to make it work?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
lgdesigner
Sr. Member
 
Avatar
Total Posts:  102
Joined:  2010-09-14
 

Igrossiter,

I could not make it work. My luck is that I had done the db dump and then I took the password table via update.
Importing via csv is very tricky!

 
Magento Community Magento Community
Magento Community
Magento Community
 
igrossiter
Jr. Member
 
Avatar
Total Posts:  14
Joined:  2008-04-14
 

vlw cara, agora q eu vi que você fala português.

mas e o problema da criptografia md5? no sistema que eu quero transferir as senhas estão todas em texto puro, iria funcionar se eu desse um up na tabela das senhas?

Vlw!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
lgdesigner
Sr. Member
 
Avatar
Total Posts:  102
Joined:  2010-09-14
 

Entendi.. são muitos cadastros?! Faça um teste e veja se funciona!

 
Magento Community Magento Community
Magento Community
Magento Community
 
larrysm
Jr. Member
 
Total Posts:  4
Joined:  2009-03-14
 

I can confirm the method of putting a colon (:) at the end of a hash works in v1.6
Here is what I did to replace existing passwords: (i assume it would work if you are making new customers)

1. go to system>import/export>export choose customers, all fields. save the csv file that you get
2. open up the csv file.
3.  pick any customer, delete the value in the “password_hash” column.
4. if you have a MD5 hash already - put it in the column and add the colon to the end.
4a. if you have a plain text password - you need the md5 hash. I used this generator to make a hash. Example: the hash for “password’ is 5f4dcc3b5aa765d61d8327deb882cf99
5. so my password_hash field now has 5f4dcc3b5aa765d61d8327deb882cf99: for that customer. (notice the colon at end)
6. import the file back into Magento. choose “replace”
7. test it - “password” is now the password for that customer.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gfxpixeldesigns
Member
 
Total Posts:  48
Joined:  2009-06-26
 

I’m trying to import 16000 customers following the suggestions found in this thread but my passwords are refusing to import.

They are coming from a joomla website running virtuemart and the passwords are in the format:

c957d358c8a79e66af10086b53b5a069:AuHg2mCXUhViqKYCLtFco22rmUCDwIFI

I’m not exactly sure on the encryption method virtuemart uses so this could be my problem. I’m assuming the first string before the : is an md5hash and the string after the : is a salt.

After scouring the web though it appears a salt should only be 2 characters long, atleast thats what i’ve found magento to be using so i may have the above wrong and it could be a different encryption all together.

Would anyone have any other suggestions for me or could someone atleast tell me what encryption my passwords are in ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
cloverpeek
Jr. Member
 
Total Posts:  3
Joined:  2012-07-17
 

dos this works if I transfer data from Magento Go to Magento CE?

cloverpeek.com

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 3 of 3