How to Import Customers & Customer Addresses to Magento 2

- Magento 2

magento import customers

Today, we are going to talk about the Magento import of customers. It’s a routine process that requires a couple of preparation. You may use either the default Magento 2 import tool or a third-party importer to simplify this process. If you don’t know how to import customers to Magento 2, you’ve come to the right place. Below, we shed light on Magento 2 customer import.

There are three separate entities designed to simplify the import of customer data from external sources: Customers Main File, Customer Addresses, and Customers And AddressesBelow, we describe each one.

Your journey into the world of the Magento 2 customer data import starts with a sample CSV. We explain how to get a file with customers and addresses and describe the structure of the corresponding import table. Next, you will discover what Magento 2 customer attributes are used to import data to your website. The article focuses on attributes associated with the Customers Main File, Customer Addresses, and Customers and Addresses entities used in Magento 2. Besides, we explain attribute mapping for transferring customers from external platforms. So, let’s see how to import customers and customer addresses to Magento 2.


Magento Import of Customers: Sample CSV

There are three ways of obtaining a sample CSV necessary for the Magento 2 import of customers:

  • Magento 2 Admin. Go to System -> Data Transfer -> Import, select the entity from the ‘Entity Type’ dropdown, and download your sample file.
    magento import customers: download sample file
  • At GitHub. Navigate to the FIreBear Studio GitHub and download the file with the required entity type.
  • At Google Sheet Master Table. The FireBear team composed a Google Sheet where you can find all import entity types with descriptions and sample values.

Now that you have the sample file, you can use it to compose a CSV with the data necessary to import customers to Magento 2. To get a complete understanding of the CSV table formatting and Magento 2 customer attribute – read the following chapter.

Read more about Google Sheet Master table

Magento 2 Customer Import CSV: Character Set, Separators & Delimiters

The import table can be either a CSV file, if you rely on the native Magento 2 import, or CSV, XML, or Google Sheets if you use the Improved Import and Export extension.

If you have decided to create the table manually make sure to edit the field separators, text delimited, and character set with these requirements in mind:

Character set Unicode (UTF-8)
Field separator Comma, Tab
Text delimiter

In case you want to stick to your table formatting, or your supplier provides you with the custom formatted table for Magento customer import, you can always take advantage of the field mapping right inside the import screen of the Improved Import & Export extension. We will return to this possibility below.

Magento 2 Customer Import Attributes

When it comes to the Magento import of customers, there are three types of entities that you can import to your Magento 2 store:

  • Customers Main File. This one stores your import customer credentials and personal account information;
  • Customer Addresses. You can find customers’ billing and shipping addresses with all associated information in this file;
  • Customers and Addresses. Think of it as a conjunction of the first two types, except for some customer attributes.

Now that we have listed all three Magento 2 customer import entities let’s get through the attributes listed in the corresponding CSVs:

Magento 2 Customers Main File Attributes

You can get a full Magento 2 Customers Main File sample table with the attribute description and sample value reference in the Master Google Table. There you can click every customer attribute and get a quick reference of the attribute and which value is expected for a successful Magento import of customer data.

The ‘Customers Main File’ contains the following columns:

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 disabled

0 – 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 Male

Female

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

Magento 2 Customer Addresses Attributes

As with the Customers Main File, you can get a complete import table with all the attributes described from the Master Google Table.

The attributes required for a successful Magento customer import include:

Attribute Name Reference Values Value Example
_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
_email Email of the customer Make sure to properly paste the email address with the domain john.doe@test.com
_entity_id Internal ID of the customer address used for identification purposes inside of Magento 2 Numeral value 1
city City of the customer Can be any character value Calder
country_id Country of the customer For a full list of country IDs refer to the Country and State Codes sheet FireBear Studio
company Company of the customer  Can be any value DE
fax Fax of the customer Can be any numeral value 5555555555
firstname Customer’s first name Can be any character value John
lastname Customer’s last name Can be any character value Doe
middlename Customer’s middle name Can be any character value D
postcode The postcode of the customer Can be any numeral value 12345
prefix Customer’s name prefix Can be any character value Mr.
region Region of the country of the customer Refer to the Country and State Codes sheet for the proper region name or state code. Both can be entered in this field BRG
region_id Region ID of the country of the customer Refer to the Country and State Codes sheet for proper region ID 83
street Name of the street of the customer Can be any character or numeric value Test 23
suffix Customer’s name suffix Can be any character value Jr.
telephone Customer’s telephone number Can be any numeral value 5555555555
vat_id Customer’s VAT Can be any proper VAT value EU555555555
vat_is_valid VAT number validity 1 – the VAT number is valid

0 – the VAT number is not valid

0
vat_request_date VAT number validation request date The data format is:

yyyy/mm/dd

2018-02-21
vat_request_id VAT number validation request ID Proper validation request ID 20
vat_request_success VAT number validation request success 1 – success

0 – failure

1
_address_default_billing_ Defines if the imported address of the customer is the default for Billing 1 – the address is the default

0 – the address is not the default

1
_address_default_shipping_ Defines if the imported address of the customer is default for Shipping 1 – the address is the default

0 – the address is not the default

1

Magento 2 Customers and Addresses Attributes

The Customers and Addresses table combines both Customers Main File and Customer Addresses table attributes. However, you cannot compose this type of table by combining the attributes from the latter two. A successful Magento 2 import of customers requires proper attribute naming described in our Master Google Sheet.

Or you can use the table below to compose a CSV or for reference purposes.

Attribute Name Reference Values Value Example
increment_id Unique customer address identifier which you can use to import multiple addresses for a single customer. Use the same value for every unique customer with different addresses. Only numerals allowed 12
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 disabled

0 – 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
firstname First Name of the customer Any characters allowed John
gender The gender of the customer Male

Female

leave blank if not specified

Male
group_id The 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
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 ef55cebdb2034a89
prefix Name Prefix of the customer Any character value Mr.
rp_token Reset the password token of the customer account Proper token value 09ae7838f74dc08343252255d7c69bf8
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
website_id ID of the website the customer belongs to Numeric website ID 1
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
_address_city City of the customer Can be any character value Potsdam
_address_company Company of the customer Can be any value FireBear Studio
_address_country_id ID the customer’s country For a full list of country IDs refer to the Country and State Codes sheet of this table DE
_address_fax Fax of the customer Can be any numeral value 5555555555
_address_firstname The customer’s first name for the address Can be any character value John
_address_lastname The customer’s last name for the address Can be any character value Doe
_address_middlename The customer’s middle name for the address Can be any character value D
_address_postcode The postcode of the customer Can be any numeral value 12345
_address_prefix Customer’s name prefix for address Can be any character value Mr.
_address_region Region of the country of the customer Refer to the Country and State Codes sheet of this table for the proper region name or state code. Both can be entered in this field BRG
_address_street Name of the street of the customer Can be any character or numeric value 83
_address_suffix The customer’s name suffix for the address Can be any character value Jr.
_address_telephone The customer’s telephone number Can be any numeral value 5555555555
_address_vat_id The customer’s VAT for the address Can be any proper VAT value EU555555555
_address_default_billing_ Defines if the imported address of the customer is the default for Billing 1 – the address is the default

0 – the address is not the default

1
_address_default_shipping_ Defines if the imported address of the customer is default for Shipping 1 – the address is the default

0 – the address is not the default

1

Now, that you have learned all customer attributes it is time to proceed to the actual import.

Magento 2 Customer Import Guide

You are probably familiar with the native Magento 2 import procedure, that’s why we’ll describe how to import customers using the Improved Import and Export extension. The module offers a bunch of advantages over the default import procedure. For instance, it supports a broad selection of file formats and sources, provides automation, and lets you map third-party attributes to the ones Magento 2 requires. The Magento 2 customer import becomes way more powerful and user-friendly if you use the Improved Import & Export extension.  

Follow these steps to import customers to Magento:

Step 1: Create a Customer Import Job

The import job can be created as follows:

  1. Go to System -> Improved Import / Export – > Import Jobs
  2. Click the ‘Add New Job’ button.
  3. Name the job to identify it in the job list.
  4. Set the job schedule if you want to automate your customer import to Magento 2. Specify the locale of the store you will be importing to.
    Note that this feature is not available in Magento 2 by default.

magento import customers: automation

Step 2: Select an Entity & Behavior

When done with the general settings, you will need to select an entity. You can import Magento customers via one of the following CSVs:

  • Customers Main File;
  • Customer Addresses;
  • Customers and Addresses.

magento import customer data: select entity

We have described the table structure for every entity above, so we consider that you have already composed a table.

Next, configure the import behavior. In the ‘Import Behavior’ section, select one of the following options:

  • Add/Update – add new customers and update the existing ones;
  • Replace – replace customers with new ones;
  • Delete – delete old customers.

magento import customers: choose behavior

Then, you can select one of two options: Stop on Error and Skip Error Entries. Specify the number of errors to halt the customer import process. Enter field and multi-value separators. Enable Magento 2 fields enclosure if it is used in your Magento customer import CSV file. This is especially handy in case you are trying to import a table with custom formatting.

Step 3: Specify a Customer File Type & Source

With the Improved Import and Export extension, you can import customers to Magento 2 using not only CSV but also XML, XLSX, ODS, and JSON files. The extension also provides the ability to transfer customer data from different sources, including

  • Manual file uploads;
  • FTP/SFTP file transfers;
  • Direct URL uploads;
  • Google Sheet customer import.

For example, if you use a single Google Sheet to approve edits, the only thing you are left to do to import customers to Magento 2 – is to paste the link to the corresponding table and you are good to go. The sheet can be edited and then imported automatically according to the specified interval, speeding up your import management process. Nothing similar is available in the standard Magento import of customer, product, order, and other tables.

magento import customers: file format and source

After the file has been uploaded click the ‘Validate file’ button, to let the extension make sure the table is properly formatted.

Step 4: Map Customer Attributes to Magento 2 Attributes

If your customer import table contains third-party attributes, you can easily make them suitable for the internal requirements of Magento 2. 

The attribute mapping screen lets you either select the platform you are importing from and let the extension do the rest of the mapping process or you can map all the attributes manually:

  1. Choose a system attribute.
  2. Specify a third-party attribute from your customer import CSV.
  3. Set the default value that will be applied to empty rows.
  4. Repeat this procedure for all third-party attributes used in your Magento 2 customer import.

magento import customer attribute mapping

Now, click the ‘Save & Run’ button followed by the  ‘Run’ button to import customers to Magento 2. The extension will present you with the import log where you can check how the import process went.

magento customer import progress

This is it! You have just imported customers to your store using the Improved Import and Export extension.

Get Improved Import Magento 2 Extension

Improved Import and Export extension enhances Magento 2 customer import and other data transfer procedures by introducing the following features:

  • Google Sheet Magento 2 import source support;
  • Import tier prices with products;
  • Configurable products can be created on the fly;
  • Automatically upload and synchronize external product listing with M2;
  • No programming skills required;
  • CSV, XML, XLSX, ODS & Google Sheets support;
  • Flexible cron jobs (admin run, CLI);
  • Powerful import & export mapping for any data structure with filters and static values;
  • Categories, attributes, and attribute values import;
  • Orders, invoices, shipping export;
  • Supported sources: FTP, SFTP, URL, Dropbox;
  • Support all product types, customers, orders;
  • Magento 1 and Shopify migration presets;
  • User-friendly & intuitive interface.

If you are interested in importing other entities to your Magento 2 store – refer to the blog posts in our Magento 2 import/export guide list.

Magento 2 Customer Import FAQ

How to import customers into Magento?

As you can see, there are two ways to import customers into Magento 2. Firstly, you can use the platform’s default data transfer solution. Although it is built into the system, the standard customer import mechanism is limited. It doesn’t let you import customers on schedule, transfer them with the help of XLSX, ODS, or JSON files, move from Google Sheets, or deliver them to your e-commerce website via APIs. Alternatively, you can implement the same process using the Improved Import & Export extension. It avoids all the limitations mentioned above. Besides, the module offers a robust mapping functionality, described in this article.

How to import customers from Magento into Shopify?

If you decide to migrate from Magento 2 to Shopify or just need to synchronize data between the two storefronts, Improved Import & Export also comes in handy. The solution lets you import customers from Magento into Shopify with minimum effort. You only need to apply the correct mapping to the Magento data. We also offer the Improved Import & Export tool for Shopify which will help you transfer customers to the storefront. Alternatively, it is possible to establish an API connection between the two systems, synchronizing customer transfers between the two websites in both directions.

How to import WooCommerce customers into Magento?

The situation is similar to the one that happens around the Magento 2 Shopify integration. You need to install the Improved Import & Export extension to establish the connection between the two systems, moving customers from WooCommerce into Magento.

How to run Magento customer import from Google Sheets?

You can use the Improved Import & Export Magento 2 module to import customers from numerous sources, including Google Sheets. The extension provides the ability to choose the desired storage when you configure an import profile. Just select Google Sheets as your data source and specify the URL address of a file with customers to import the corresponding update to your Magento 2 website.

How to run Magento import of customers from Dropbox?

In addition to Google Sheets, you can also transfer customer data to Magento 2 from Dropbox. Provide the address details of a file stored there and the Improved Import & Export extension will easily move it to your e-commerce storefront. Note that it should be a CSV, XML, ODS, XLSX, or JSON file. You can provide them in a compressed state as ZIP or TAR archives.

How to import Magento 2 customers from a CSV file?

You can use the Improved Import & Export Magento 2 extension to import customers via a CSV file. Follow the instructions mentioned in this article to configure the corresponding import process. Choose a CSV file as your import file type.

How to import Magento 2 customers from an XML file?

You can use the Improved Import & Export Magento 2 extension to import customers via an XML file. Follow the instructions mentioned in this article to configure the corresponding import process. Choose an XML file as your import file type.

How to run Magento customer import from an ODS file?

You can use the Improved Import & Export Magento 2 extension to import customers via an ODS file. Follow the instructions mentioned in this article to configure the corresponding import process. Choose an ODS file as your import file type.

How to run Magento 2 import of customers from an XLSX file?

You can use the Improved Import & Export Magento 2 extension to import customers via an XLSX file. Follow the instructions mentioned in this article to configure the corresponding import process. Choose an XLSX file as your import file type.

How to import Magento 2 customers from a JSON file?

You can use the Improved Import & Export Magento 2 extension to import customers via a JSON file. Follow the instructions mentioned in this article to configure the corresponding import process. Choose a JSON file as your import file type.

How to import Magento 2 customers in a ZIP or TAR archive?

You can use the Improved Import & Export Magento 2 extension to import customers in a ZIP or TAR archive. Note that they should be stored in a CSV, XML, ODS, XLSX, or JSON file.

How to import Magento 2 customers via API?

You can use the Improved Import & Export Magento 2 extension to import customers to Magento 2 via API. The module provides the ability to create a direct connection between the two systems so that you avoid the use of intermediate data exchange points and file transfers.

How to export customers from Magento 2?

It is possible to export customers from Magento 2 with the help of the default data transfer tools. Go to System > Export and select Customers Main File or Customer Addresses depending on your export needs. Configure entity attributes, creating filters. Run the export process. That’s it. However, you cannot apply mapping, create any files except CSV, export customers on schedule, or transfer them via API. If you need all these features, pay heed to the Improved Import & Export Magento 2 extension. The module delivers advanced data transfer capabilities. As a result, you can export customers from Magento 2 in many more ways. Firstly, the plugin’s mapping interface lets you create output that is suitable for the requirements of an external platform. Secondly, the extension lets you create cron-based schedules so that the data output is generated automatically. Thirdly, you can export customers from Magento 2 in numerous file formats to multiple sources, such as FTP, SFTP, Dropbox, etc. Fourthly, the plugin lets you create an API connection between Magento 2 and the external platform you want to move the customer data to. These and many more useful enhancements are available in the Improved Import & Export Magento 2 module.

Final Words

In Magento 2, customer import is associated with three types of CSV files: Customers Main File, Customer Addresses, and Customers And Addresses. If you know the selection of attributes and values used in each file, you can easily import customers to Magento. Furthermore, the Improved Import & Export extension can help you simplify this process even if your CSVs contain third-party attributes. With our module, you no longer need to edit your customer import tables manually to change column names. Just match the names from your file to the default attributes to successfully run the Magento import of customers. Follow this link for more information about our module:

Get Improved Import Magento 2 Extension