Skip to main content
Magento 2

How to Import Customers in Magento 2?

Step-by-step guide to importing customer data into Magento 2 from CSV files.

How to Import Customers in Magento 2?

Importing customers in bulk saves time and helps migrate data from other platforms. Learn how to import customers in Magento 2.

Why Import Customers

  • Migrate from another platform
  • Bulk add customers
  • Update customer data
  • Import from spreadsheet
  • Restore from backup
  • Integrate with CRM

Preparing CSV File

Your CSV must include:

  • email (required)
  • firstname (required)
  • lastname (required)
  • company (optional)
  • telephone (optional)
  • street (optional)
  • city (optional)
  • country_id (optional)
  • postcode (optional)

CSV Format Example

Code implementation available in the full documentation.

Steps to Import Customers

  • Go to System > Import/Export > Import
  • Select Entity Type > Customers
  • Set Import Behavior (Add/Update/Replace)
  • Upload your CSV file
  • Validate data
  • Review validation results
  • Click “Import”

Import Behaviors

  • Add/Update: Add new, update existing
  • Replace: Remove all existing, add new
  • Delete: Remove customers from CSV

Customer Address Import

To import addresses:

  • Use Customer Addresses entity type
  • Include required address fields
  • Match customer email for linking
  • Set as default address if needed

Validation Tips

  • Check email format
  • Verify country codes
  • Validate postal codes
  • Check required fields
  • Review error messages
  • Fix issues before importing

Best Practices

  • Always validate before import
  • Keep backup of original data
  • Test with small sample first
  • Use Add/Update mode for safety
  • Verify passwords if included
  • Check imported data after completion
  • Maintain audit trail

Common Issues

  • Invalid email format
  • Missing required fields
  • Wrong country codes
  • Duplicate emails
  • Encoding issues

Command Line Import

Code implementation available in the full documentation.

Need help with this?

Get managed Magento hosting tuned for performance.

Learn more