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

Import Customer Passwords
 
katiek648
Member
 
Total Posts:  33
Joined:  2008-04-10
 

I have a separate database of users that I would like to import into Magento so that those users can log in with the same email/password. However, I noticed that the import will only accept encrypted/hashed passwords. How do I go about importing our current passwords? What type of hashing does Magento use.

Thanks in advance for any help!

Katie

 
Magento Community Magento Community
Magento Community
Magento Community
 
koyan
Jr. Member
 
Total Posts:  29
Joined:  2008-02-28
 

i would like to know how to do this as well.

and as an lesser alternative, is there an option to leave these blank and send a BULK password reset?
i dont fancy sending 1000 odd individual password reset emails :|

 
Magento Community Magento Community
Magento Community
Magento Community
 
uni-man
Member
 
Total Posts:  34
Joined:  2008-04-04
 

Hi
You can use setPasswordHash() like this: (where $row is an array of your data to be imported)

$customerEntityType Mage::getModel('eav/entity')->setType('customer')->getTypeId();
$website Mage::getModel('core/website')->load'base''code');
$websiteID $website->getId();
$customer Mage::getModel'customer/customer' );
$customer->setWebsiteId   $websiteID );
$customer->setWebsiteCode 'base' );
$customer->setGroup       'General' );
$customer->setEmail       $row['EmailAddress');
$customer->setFirstname   $row['FirstName');
$customer->setLastname    $row['FamilyName');
$customer->setPasswordHash$row['LoginPassword'); // the md5 encrypted password
$customer->setIsSubscribed$row['WantsNewsletter');
$customer->save();

hope this helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
saloob
Jr. Member
 
Total Posts:  9
Joined:  2008-11-03
 

Hi Uni-man,

Thanks for your post - but can you help me a bit more.
How can the code you provided be used? Where do I put it? How do I use it?

I have a database (csv) of customers - but it didn’t allow password export - which means I have to make hundreds of random passwords.
Could this code be modified to also provide;

1) Random Password creator, then
2) HASHiser (I think as you have now), then
3) Email Notification with Username & Password.

Thanks in advance for any help/advice!

Regards,

ME

 
Magento Community Magento Community
Magento Community
Magento Community
 
ptnplanet
Member
 
Total Posts:  45
Joined:  2008-06-13
 

Try using http://www.maord.com/ to create passwords.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top