I am trying to import customer info into magento2, but my old website use MD5 to store the passwords. Does magento2 support MD5 ? How to make MD5 work for magento2 ?


There is no need to add extra code or plugins to support the MD5 hash in Magento 2. If you want to import the passwords directly you just have to add ":0" after the raw password from Magento 1.

Magento 2 supports multiple versions to hash the password. Version 0 is MD5, which is used by Magento 1.

The passwords in Magento 2 are formatted as: {password hash}:{salt}:{hash version}

The passwords in Magento 1 are formatted as: {password hash}:{salt}

  • Does this apply to password or password_hash, for importing customers by .csv?
    – zekia
    Oct 22 '18 at 9:55
  • Add it on password_hash field
    – Aurélien
    Jul 19 '19 at 8:51

I'd recommend using Magento's data migration tool for Magento 1 - Magento 2; it should move over the customer information for you, along other information as well. I believe that Magento 2 is using SHA256 and also support MD5 for password hashing for customer passwords.

Here's a link to download the tool: http://devdocs.magento.com/guides/v2.0/migration/bk-migration-guide.html

However, if you're curious, you could try just copy-pasting the encrypted passwords from one server to the next, and see if it works. I would recommend doing this on a test environment, and making sure that you back up the data. I've done this for a Magento 1 to Magento 1 site.

I hope this helps!


Might not be the exact same issues as you but I managed to fix my customer passwords by using this - https://magento.stackexchange.com/a/294312/46258

P.S. You will need to clear out generated/ and rebuild. I'm using:

cd /var/www/html
sudo rm -rf var/cache/* var/page_cache/* var/composer_home/* var/generation/* var/view_preprocessed/* pub/static/frontend/* pub/static/adminhtml/* generated/code/* generated/metadata/*
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_GB -f
php bin/magento setup:static-content:deploy en_US -f
sudo chown -R www-data:www-data .
php bin/magento cache:clean
sudo chown -R www-data:www-data .

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.