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 2 of 3
Import customers with md5 password
 
ashish96
Member
 
Avatar
Total Posts:  63
Joined:  2009-01-21
Gujarat, India
 

@mweather
if u r importing customers through csv files,
then u have to enter encrypted password in store for customer,
there is no function which is offering the facility of md5 hash, if u import ur customers then password will be bottleneck, as per my concern…
if u have any perfect idea then plz explain…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

ashish96,

I don’t quite understand what your specific problem is. Could you explain more details?

Do you have the raw passwords in your CSV files, or do you have passwords with MD5 hash already applied?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kayakbabe
Jr. Member
 
Total Posts:  23
Joined:  2008-12-01
 

What I am reading, is that they have a customer export from oscommerce. the passwords are md5 encrypted already. They want to move the customers data to the magento store.

I’m also understanding from everyone’s posts that this is very easy to do, since Magento uses the same MD5 hash method as Oscommerce.
So as long as the magento store is on the same server as the oscommerce store was, the saltkeys are the same, then it should be a simple matter of just making sure the oscommerce passwords are directly inserted into the magento customer password data field. right?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

If you have md5 hashed and salted passwords already from osCommerce, then all you need to do is label that column “password_hash” in your CSV file to import and viola, it should work like a charm.

Note: the passwords should look like this: [password_hash]:[salt]
If you don’t have the colon (:) I think you need to add it to the end of the password_hash.

Send me your CSV file if you need more help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

Sorry - duplicate post.

 
Magento Community Magento Community
Magento Community
Magento Community
 
svert
Jr. Member
 
Total Posts:  1
Joined:  2009-04-14
 

First: thanks to all, this topic helped me smile
Second: just a remark, MD5 is not an encryption method. A password hashed with it cannot be decrypted (see lastest researches for “collision” problems ...)

thx

 
Magento Community Magento Community
Magento Community
Magento Community
 
James Thompson
Jr. Member
 
Total Posts:  29
Joined:  2009-01-23
 

As the osCommerce Migration tool doesn’t work with the latest version of Magento I am importing all of my osCommerce customers manually.

The problem I have come across is that the passwords don’t work. I understand from this thread that if I import the password hash it should just work as before but no joy.

My password hashes from osCommerce look like

5c7d655fa3ee6ae09698856713762082:05

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

That looks to be valid. Did you save the column as “password_hash” in your CSV import file?

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

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
CT Schubert
Sr. Member
 
Avatar
Total Posts:  197
Joined:  2008-10-08
Southern California
 

Thought I’d share this here and wherever else I can find use to share this bit of info.

I was importing my customers from oscommerce to magento and was running into this bit of trouble:

The oscommerce store allows passwords with a min. of 5 characters, magento requires 6 by default, if you need to fix this so magento will allow 5

edit:
/js/prototype/validation.js
/js/prototype/validation-4min.js

['validate-password''Please enter 6 or more characters. Leading or trailing spaces will be ignored.', function(v{
                
var pass=v.strip(); /*strip leading and trailing spaces*/
                
return !(pass.length>&& pass.length 6);
            
}],

Change the 6 in that code to 5 and the form will now validate!

 
Magento Community Magento Community
Magento Community
Magento Community
 
ipascual
Member
 
Avatar
Total Posts:  32
Joined:  2009-07-13
London
 

weeeee!

Use this function:

$string=$your_old_password;
$salt=2;
    
$salt = (ctype_digit($salt) ? $salt 2);
    
$chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    
mt_srand(10000000 * (double)microtime());
    for (
$i 0$str ''$lc strlen($chars) - 1$i $salt$i++) {
     $str 
.= $chars[mt_rand(0$lc)];
    
}
    $password_hash
=md5($str $string) . ":" $str;

$your_old_password is the password from your old database
$password_hash will contain the password for use in the *.CSV file!

take care!
Nacho

 
Magento Community Magento Community
Magento Community
Magento Community
 
Keith Moon
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2009-03-08
London
 
elnacho - 14 August 2009 04:30 AM

weeeee!

Use this function:

$string=$your_old_password;
$salt=2;
    
$salt = (ctype_digit($salt) ? $salt 2);
    
$chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    
mt_srand(10000000 * (double)microtime());
    for (
$i 0$str ''$lc strlen($chars) - 1$i $salt$i++) {
     $str 
.= $chars[mt_rand(0$lc)];
    
}
    $password_hash
=md5($str $string) . ":" $str;

$your_old_password is the password from your old database
$password_hash will contain the password for use in the *.CSV file!

take care!
Nacho

Hey Nacho, where should I use this function??
Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Avatarus
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2009-12-29
 

if you want to import customrs form diferent stro application, and that application use plain md5 password hash, just add : on end of that password
just like here:
http://www.magentocommerce.com/boards/viewthread/16700/

it worked for me in magento 1.4.0.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
AppliBox
Member
 
Avatar
Total Posts:  61
Joined:  2010-04-12
France
 

Hi!

I must to transfer customers of a old platform to Magento platform.
In my old platform, i have md5 password.

I try to put \":\" at the end of my md5 passwords in the CSV file to import in Magento. But when import is ended it\’s impossible to connect whith the customer\’s account.

Somebody has already succeed in this operation ?

Thanks in Advance

 
Magento Community Magento Community
Magento Community
Magento Community
 
haligonia
Sr. Member
 
Total Posts:  97
Joined:  2009-02-28
 

I want to export my customers using System > Import/Export > Profiles and import them into a new installation. Is this procedure going to preserve their login information (including password) so they can get into the new installation with their previous login and password?

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