merge customer accounts in Magento 2

Sometimes we need when old orders using an email address no longer in use by the customer exist and then the customer has purchased again recently with a new email address and they want to combined order history together into the new account. There is no such backend functionality, but it must be possible by editing the database directly.

To merge customer accounts in Magento 2, you can follow these steps:

 

  • Backup your Magento 2 store: Before making any changes to your store, it's always a good idea to backup your store in case anything goes wrong.
  • Identify the customer accounts to be merged: Identify the customer accounts that you want to merge. Make a note of the customer ID of the account that you want to keep, as you will need this later.
  • Disable Customer Sharing: Disable Customer Sharing in your Magento 2 store by going to Stores > Configuration > Customers > Customer Configuration > Account Sharing Options and set "Share Customer Accounts" to "No".
  • Merge customer accounts: To merge two customer accounts, you will need to transfer the information from the account you want to delete to the account you want to keep. This includes order history, addresses, and any other customer information. You can do this manually or use a third-party extension to simplify the process.
  • Delete the redundant customer accounts: Once you have transferred all the necessary information to the account you want to keep, you can delete the redundant customer accounts. To do this, go to Customers > All Customers, select the accounts you want to delete, and click "Delete".
  • Reindex and Clear Cache: Reindex your Magento 2 store and clear the cache to ensure that the changes are reflected on your storefront.

 

It's important to note that merging customer accounts in Magento 2 can be a complex process, and you should always test your changes on a development or staging environment before making any changes to your live store.

Check our readymade Merge Customer Accounts for Magento 2 extension, explore its features and use it in your website.