---
title: "How to transfer your Customers from Magento 1.x to Magento 2"
url: "https://magecomp.com/blog/transfer-customers-magento-1-x-magento-2/"
date: "2019-05-27T16:32:50+00:00"
modified: "2025-02-25T12:49:37+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 673
reading_time: "4 min read"
summary: "The database is a well-organized collection of information that can be easily accessed, managed and updated, and this data is stored in rows, columns, and tables, and with its own index that makes ..."
description: "Sometimes it happens that the store admin wants to transfer all their old Magento 1.x store customers to New Magento 2.x which is a cumbersome task if you ar..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Get Active Payment Methods with Multi select in Backend"
    url: "https://magecomp.com/blog/get-active-payment-methods-with-multi-select-in-backend/"
  - title: "Magento 2: How to Move Billing Address before Payment Methods in Checkout Page"
    url: "https://magecomp.com/blog/magento-2-move-billing-address-before-payment-methods-in-checkout-page/"
  - title: "How to add Quantity Increment &amp; Decrement Button to Product page in Magento 2?"
    url: "https://magecomp.com/blog/add-quantity-increment-decrement-button-product-page-magento-2/"
---

# How to transfer your Customers from Magento 1.x to Magento 2

_Published: May 27, 2019_  
_Author: Dhiren Vasoya_  

![How to transfer Customer From Magento to Magento 2](https://magecomp.com/blog/wp-content/uploads/2019/05/How-to-transfer-Customer-From-Magento-to-Magento-2-1024x332.webp)

The database is a well-organized collection of information that can be easily accessed, managed and updated, and this data is stored in rows, columns, and tables, and with its own index that makes it easier to fetch relevant information whenever needed. One powerful eCommerce CMS Magento relies on MYSQL Database which is completely open source and one of the most popular languages for adding, accessing and managing content in a database in an easy and flexible way. And your customer’s information plays a vital role in your business because without having your customer’s information your business is almost incapable of doing marketing and suggest products to your customers.

[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2023/10/Magento-2-Speed-Performance-Optimization-Services-CTA-4.webp)](https://magecomp.com/magento-performance-optimization.html)
Sometimes it happens that the store admin wants fresh Magento 2 update without importing all the data back or admin came across a requirement of just transferring Magento 1 store customers to Magento 2 store which is a cumbersome task if you are the newbie. So, we are back with another powerful script that will help you to transfer all your customer information to your Magento 2 stores including store credentials, address and other information.
To do the same first we need to create **‘customer.php’** in Magento 1.x root folder to generate a main customer CSV file that we will later import to Magento 2 store.

```
<!--?php try { include_once('app/Mage.php'); Mage::app('admin'); $collection = mage::getModel('customer/customer')->getCollection();
$fp = fopen('customer.csv', 'w+');    $csvHeader = getHeadRowValues();    fputcsv($fp, $csvHeader,",");
    foreach($collection as $customer1){        $customer = Mage::getModel('customer/customer')->load($customer1->getId());        $record = array(            $customer->getEmail(),            "base",            "default",            "",            $customer->getCreatedAt(),            $customer->getCreatedIn(),            $customer->getDisableAutoGroupChange(),            $customer->getDob(),            $customer->getFirstname(),            "",            "1",            $customer->getLastname(),            $customer->getMiddlename(),            $customer->getPasswordHash(),            $customer->getPrefix(),            "",            "",            $customer->getStoreId(),            $customer->getSuffix(),            $customer->getTaxvat(),            $customer->getUpdatedAt(),            $customer->getWebsiteId(),            ""     );        fputcsv($fp, $record, ",");}    fclose($fp);}catch (Exception $e){echo $e->getMessage();}function getHeadRowValues(){return array(        "email",        "_website",        "_store",        "confirmation",        "created_at",        "created_in",        "disable_auto_group_change",        "dob",        "firstname",        "gender",        "group_id",        "lastname",        "middlename",        "password_hash",        "prefix",        "rp_token",        "rp_token_created_at",        "store_id",        "suffix",        "taxvat",        "updated_at",        "website_id",        "password");}?-->```

After that, we need to create one more **‘customeraddress.php’** script in the same location of Magento 1.x root folder for creating all customer address CSV file.

```
<!--?php try { include_once('app/Mage.php'); Mage::app('admin'); $collection = mage::getModel('customer/customer')->getCollection();
$fp = fopen('customer.csv', 'w+');    $csvHeader = getHeadRowValues();    fputcsv($fp, $csvHeader,",");
    foreach($collection as $customer1){        $customer = Mage::getModel('customer/customer')->load($customer1->getId());        $record = array(            $customer->getEmail(),            "base",            "default",            "",            $customer->getCreatedAt(),            $customer->getCreatedIn(),            $customer->getDisableAutoGroupChange(),            $customer->getDob(),            $customer->getFirstname(),            "",            "1",            $customer->getLastname(),            $customer->getMiddlename(),            $customer->getPasswordHash(),            $customer->getPrefix(),            "",            "",            $customer->getStoreId(),            $customer->getSuffix(),            $customer->getTaxvat(),            $customer->getUpdatedAt(),            $customer->getWebsiteId(),            ""     );        fputcsv($fp, $record, ",");}    fclose($fp);}catch (Exception $e){echo $e->getMessage();}
function getHeadRowValues(){return array(        "email",        "_website",        "_store",        "confirmation",        "created_at",        "created_in",        "disable_auto_group_change",        "dob",        "firstname",        "gender",        "group_id",        "lastname",        "middlename",        "password_hash",        "prefix",        "rp_token",        "rp_token_created_at",        "store_id",        "suffix",        "taxvat",        "updated_at",        "website_id",        "password");}?-->```

[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-2.webp)](https://magecomp.com/services/hyva-theme-development/)

After running both the script in your Magento 1.x root folder now you can find “**customer.csv**” file that is generated using the first script and “**customerAddress.csv**” file that is generated after successful execution of the second script.
Now it’s time to import these CSV files into your Magento 2 backend and for that purpose navigate to **System->Import**

For importing “customer.csv” file select “Customers Main File” option from the dropdown and for importing “customerAddress.csv” select Customer Addresses option from the dropdown and select remaining option according to your business need.

That’s it! If you found this blog helpful, don’t forget to share it with your colleagues and Magento Friends.

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-3.webp)](https://magecomp.com/services/hire-magento-programmer/)
And, Let us know if you are facing an issue while implementing this code.
Happy Transfer!


---

_View the original post at: [https://magecomp.com/blog/transfer-customers-magento-1-x-magento-2/](https://magecomp.com/blog/transfer-customers-magento-1-x-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-10-06 01:55:12 UTC_  
