How To Import Customer Passwords To Magento 2

magento 2 change customer password in database

What if you need to transfer customer data to Magento 2 or change the customer password in a database? You may try to use the default import tool to do that. However, it doesn’t let you move all the prospect-related information to your database. For instance, it is impossible to migrate customer passwords from external systems. Attempts to address this problem have been made utilizing numerous approaches. Below, we describe two of them. 

You will learn how to import passwords to Magento 2 from external systems by manually editing your data files. Alternatively, we describe how to import the existing customer data including passwords to your e-commerce website based on the Improved Import & Export extension. Thus, you will learn how to reset customer passwords in a database in Magento 2.

The problem is that the new platform version utilizes an updated algorithm for storing passwords. Hence, users claim that after migrating to Magento 2 from Magento 1, registered prospects have to re-enter their passwords on a new website. 

If editing passwords manually fixes the problem caused by Magento version discrepancy, Improved Import & Export dramatically extends the application sphere for customer data import. The module lets you transfer information about registered buyers from any external platform automatically with any number of unsupported attributes, including new customer passwords and the existing hash values of customer account passwords. For further useful tips, check our Cookbook.

A Community-Based Approach to Importing Customer Passwords to Magento 2

Joe describes the issue here: How to import MD5 password to Magento 2. The author tries to import customer info into Magento 2. However, his old website uses MD5 to store passwords. Therefore, Joe asks how to import the corresponding data correctly. 

According to mzzl, the solution is quite simple but may take a decent amount of time, depending on the number of your customers. The author says that no extra code is necessary to support the MD5 hash in Magento 2. It is only required to add “:0” after the raw password.

Mzzl also says that Magento 2 utilizes numerous versions to hash passwords. As for version 0, it is MD5. Magento 1 uses it.

The author also compares the formats of how passwords are stored in both Magento 1 and Magento 2. In the case of the first version, you have to deal with the following structure: 

When it comes to Magento 2, passwords are formatted as follows: 

When importing customer passwords to Magento 2, you have to add the missing part to the password_hash field.

The more customers you have, the more time you will spend editing a CSV file. Luckily, there is a more efficient solution. 

Enhanced Magento 2: Change Customer Password in Database with Improved Import

You can import customer passwords to Magento 2 along with other data in a more efficient way without editing anything. Meet the Improved Import & Export Magento 2 extension – your number-one time-saver when it comes to data transfers to and from your e-commerce websites. Together with the Free Magento 1 to Magento 2 Migration add-on, it will help you import customer passwords to Magento 2 automatically. Let’s see how to do that.

Magento 2 Customers Main File

You need to import a Customers Main File table with an additional column to change customer passwords. Below, you can see all its attributes and values involved:

Attribute Name Reference Values Value Example
email Email of the customer Make sure to properly paste the email address with the domain john.doe@test.com
_website Associate to Website. Defines to which website the customer belongs To find the value for the column navigate to Stores > All Stores > Click the required Website in the Website column and find its Code base
_store The Store View customer belongs to To find the value for the column navigate to Stores > All Stores > Click the required Store in Stores column and find its Code default
confirmation Confirmed email. Defines whether customer has confirmed their email address associated with their account 1 – the email address has been confirmed; 0 – customer needs to confirm the email address 1
created_at Account Created. Defines the date and time the account has been created The data format is:yyyy/mm/dd hh:mm:ss

The time format uses 24 hour clock

2018-01-16 9:48:37
created_in Account Created in. Defines the Website the account has been created in You need to specify the name of the store view. You can find it at Stores > All Stores > Click the required store view in the Store View column and find its Name Default Store View
disable_auto_group_change Disable Automatic Group Change Based on VAT ID 1 – the automatic group change is disabled0 – the automatic group change is enabled 0
dob Date of Birth of the customer The date should be in the following format yyyy-mm-dd 1973-12-15
failures_num The number of incorrect login attempts. Works with Maximum Login Failures to Lockout Account setting Any numeral value 0
first_failure First Failure Date. The date of the first failed login attempt The date should be in the following format yyyy-mm-dd hh:mm:ss 2018-03-30 8:33:01
firstname First Name of the customer Any characters allowed John
gender The gender of the customer MaleFemale

leave blank if not specified

Male
group_id Id of the Customer Group the customer belongs to The ID of the Customer Group can be found under Customers > Customer Groups. In ID column 2
lastname Last Name of the customer Any characters allowed Doe
lock_expires Defines the date when the account lock expires. The date should be in the following format yyyy-mm-dd hh:mm:ss 2018-03-30 8:33:01
middlename Middle Name/Initial of the customer Any character value allowed D
password_hash A hash value of the customer account password Proper hash value testhashvalue123
prefix Name Prefix of the customer Any character value Mr.
rp_token Reset the password token of the customer account Proper token value testtoken123
rp_token_created_at The date the password had been reset The date should be in the following format yyyy-mm-dd hh:mm:ss 2018-01-16 9:48:37
store_id ID of the store the customer belongs to Numeric store ID 1
suffix Name Suffix of the customer Any character value Jr.
taxvat Tax/VAT Number of the customer Proper VAT value EU555555555
updated_at Date when the customer’s account was last updated The date should be in the following format yyyy-mm-dd hh:mm:ss 2018-02-21 13:01:41
website_id The ID of the website the customer belongs to Numeric website ID 1
_customer_group_code A code of the Customer Group The group_id has higher priority than _customer_group_code. So if values are different, the import will take the value from the group_id attribute General
_tax_class_name A name of a tax class. This tax class is assigned to the Customer Group of a customer The _tax_class_name attribute has lower priority than _tax_class_id Retail Customer
_tax_class_id An ID of a tax class. This tax class is assigned to the Customer Group of the exported customer Numeric tax class ID 3
password If you want to change the password to the customer’s account this is the column you type it in. Any values supported by the password field testpassword123

Pay attention to the following two columns:

  • password_hash – A hash value of the customer account password;
  • password – If you want to change the password to the customer’s account this is the column you type it in.

Use one that suits your goals: you can either transfer the existing customer passwords or update them in your Magento 2 database.

Magento 2 Customer Import Process

Now, you need to import your Customers Main File to update customer passwords in a database in Magento 2. Follow these steps:

  1. Go to System->Improved Import/Export->Import Jobs and hit the “Add New Job” button.
    magento 2 change customer password in database: new import job
  2. In General Settings, enable your new job, type its title, choose the manual run frequency (if you want to transfer customer passwords regularly), select a language (locale), and enable/disable a few more features.
    magento 2 change customer password in database: import job general settings
  3. Next, proceed to the Import Settings section. Here, you can enable/disable API, choose Customers & Addresses as your import entity, and select a platform to import data from.
    Magento 2 import customer passwords: import settings
  4. In Import Behavior, choose Add/Update from the dropdown, select a validation strategy, set a limit on the number of errors, and specify separators.
    magento 2 change customer password in database: import behavior
  5. In Import Source, select an import file type. If we talk about the migration from Magento 1, it is usually a CSV format. Next, specify your import source: a server, Dropbox account, URL, or direct upload.
    magento 2 change customer password in database: import source
  6. To import customer passwords to Magento 2, hit “Save & Run” in the top right corner of the screen.

For further information about how to update customers, change customer passwords in Magento 2, or import/export other entities, follow the link below and contact our support:

Get Improved Import & Export Magento 2 Extension

Firebear Magento Migration Service

If you need to transfer not only customers and their passwords but also other entities, pay attention to the add-on since it simplifies transfers even more. It offers a similar approach to the one we’ve just described. Therefore, you only have to navigate to the Migration section, specify the path to your Magento 2 root folder, choose an entity you want to migrate, and hit ‘Run.’ That’s it! Our plugin transfers the data with no downtime!

magento 2 change customer password in database: data migration services by firebear

Some of the add-on’s features include:

  • Intuitive admin interface – no programming skills are required to migrate your Magento 1 data and import customer passwords to Magento 2;
  • CLI commands – alternatively, you can rely on intuitive CLI commands that follow the same pattern;
  • Selective migration – the following entities are supported: products, categories, customers, orders, price rules, tier prices, etc. Additional entities include reviews and ratings, catalog rules, credit memos, invoices, and URL rewrites;
  • No downtime – due to the selective entity migration, the add-on allows avoiding store downtime, relying on reindex only;
  • Custom XML filter – you can filter customer and product attributes via custom XML commands. It may simplify the way you import passwords to Magento 2.
  • Magento 2 to Magento 2 migration – you can freely move data from one store to another or even merge two stores.

Get Free Magento 1 to Magento 2 Migration add-on

In addition to the extension and add-on, the Firebear team offers a full-specter migration service. Thus, we can import customer passwords along with all entities you want to Magento 2. You provide us with access to your Magento 1 store and Magento 2 instance, and we migrate all the data you need.

It is the best option if you are not sure that you can perform the migration yourself. If you want to save time, leave it to the certified specialists who have done it a dozen times. Follow the link below to reach our support center:

Discuss the migration

Magento 2 Customer Password Import & Export FAQ

Let’s look at other nuances of importing and exporting customer passwords in Magento 2 with the help of the Improved Import & Export Magento 2 extension.

How to import and export customer passwords to Magento 2 automatically?

If you need to move customers, including customer passwords, between Magento 2 and third parties or other Magento 2 websites on a regular basis, you can use the Improved Import & Export extension since it utilizes a cron scheduler for automating all data transfers. Thus, it lets you import and export customer passwords between Magento 2 and external destinations automatically, following a schedule of updates.

How to import customer passwords with third-party attributes to Magento 2?

While Magento 2 blocks the import of unsupported data that doesn’t follow its inner requirements, such as third-party customer attributes and values, the Improved Import & Export extension can easily do that with the help of a simple trick. The module lets you create a mapping scheme where you match third-party attributes and their values to ones used within the system. Consequently, any external data is automatically adapted to the native standards of your e-commerce website every time the plugin runs a transfer. Note that you can also apply mapping to export processes to generate the output your partners require.

How to import and export customer passwords to Magento 2 via API?

With the Improved Import & Export Magento 2 extension, you can create API connections to transfer not only customer data, including passwords, but all other entities, freely moving any information between Magento 2 and external systems. There is a section in every import/export job where you can specify the parameters necessary to sync the two systems. You can create a bi-directional API connection, exchanging customer data between the two systems. As for unsupported attributes, the plugin lets you leverage its mapping functionality described above.

How to import and export customer passwords to Magento 2 via ODS files?

Improved Import & Export lets you move customer passwords along with other customer data records stored in ODS files. You no longer need to convert them to CSV to fit the Magento 2 requirements. You can also export data using this file format.

How to import and export customer passwords to Magento 2 via XLSX files?

In addition to ODS, Improved Import & Export lets you move customer passwords along with other customer data records stored in XLSX files. You no longer need to convert them to CSV to fit the Magento 2 requirements. You can also export data using this file format.

How to import and export customer passwords to Magento 2 via JSON files?

If customer passwords are stored in a JSON file, you no longer need to convert the file to CSV to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import JSON files to your ecommerce website without any necessity to run the conversion. You can also export data using this file format.

How to import data to Magento 2 via compressed files?

If your files with customer passwords are compressed, you can also transfer them to Magento 2 with the help of the Improved Import & Export extension. Remember that file archives should be saved as ZIP or TAR. The module works with compressed CSV, XML, ODS, JSON, and XLSX files.

How to import data to Magento 2 from Google Sheets?

If customer passwords are stored in Google Sheets along with other customer data records, it is no longer a problem. There is no need to export them from the service, convert the output to CSV, and then transfer the file to Magento 2. The Improved Import & Export lets you move the corresponding information straight from Google Sheets, updating your database.

How to import and export customer passwords to Magento 2 from Dropbox?

In addition to Google Sheets, the Improved Import & Export module lets you transfer customer records including passwords to Magento 2 from Dropbox. You can store them there in CSV, JSON, XML, ODS, or XLSX files or ZIP and TAR archives. You can also use this file storage as your export destination.

How to import and export customer passwords to Magento 2 from Google Drive?

In addition to Dropbox and Google Sheets, the Improved Import & Export module supports another file source. The extension lets you transfer customer passwords to Magento 2 from Google Drive. You can store them there in CSV, JSON, XML, ODS, or XLSX files or ZIP and TAR archives. You can also use this file storage as your export destination.

Final Words

If you want to update your customer passwords in Magento 2, the default import module may not cope with this task. At least, you may get stuck with tons of manual data entry. If you want to change customer passwords in a Magento 2 database, the built-in solution is useless. The Improved Import & Export extension, however, is designed to both transfer the existing customer passwords to your e-commerce website and update customer passwords in a database in Magento 2. Follow the link below and contact our support for more information:

Get Improved Import & Export Magento 2 Extension