5

I have migrated only customers from Magento 1.6.2.0 to Magento 2.2.3 and customers migrated successfully and listed properly in the admin section.

But when I try to login with the Magento 1 password I am not able to login.

So as I check in database the old passwords are stored differently than the Magento 2 passwords.

Here's a screenshot of the database table "customer_entity":

enter image description here

Basically I have found that when customer created from Magento 2 frontend there is a larger string after the first colon : and migrated passwords have only two character after the colon :.

3

As you might know, Magento 2 has changed the encryption model. It uses a new method of hashing passwords sha256(), while Magento 1 uses MD5 which produces hash values of length n=128.

However, one thing to note that Magento 2 still supports both old md5() and sha256(). That means you can have both password_hash in your Magento 2.

The data migration tool takes advantage of such backward compatibility in Magento to automatically migrate Customer password from Magento 1 to Magento 2. So your customers can use their md5() based password without the need to reset their passwords after migration. And the (migrated) customer passwords in Magento 2 remain to be 128-bit (16-byte) MD5 hashes. Such passwords will be changed to sha256() hash algorithm if:

Your users change the password themselves on the new Magento 2 instance (after migration). Or, You manually upgrade your password_hash using md5() to sha256() after migration, by running the command: php -f bin/magento customer:hash:upgrade.

if that'not work for you then

Just Empty the table (TRUNCATE) " customer_entity_varchar "

  • Thanks, This command works for me php -f bin/magento customer:hash:upgrade – Jalpesh Patel Apr 25 '18 at 10:17
  • I have done the above methods and that does not work for me. Any other suggestion? Iam using magento 2.2.4 and upgrade is from 1.9.2.4 – Divya Muralidharan Jun 27 '18 at 4:20
  • @DivyaMuralidharan is there any error you get when you perform hash:upgrade command in SSH? – Jalpesh Patel Jun 27 '18 at 4:59
  • @Jalpesh Yes. I got this error " [ReflectionException] Class Magento\Eav\Model\Attribute\Data\Datetime does not exist" – Divya Muralidharan Jun 27 '18 at 5:46
  • @DivyaMuralidharan do you have any custom attribute in magento 1.9.2.4 which type is datetime?? – Jalpesh Patel Jun 27 '18 at 6:44
0

I have created my own extension for customer migration and that was work perfectly with my Magento version: 2.2.4.

My logic: Taking Magento1 password and appending ":0" before inserting into Magento2 customer table.

Let me know if you need more info for same, I am happy to help the community!

  • Is it possible you can share your migration extension and/or logic? – Dominic Xigen Jul 11 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.