Database – Importing Customers From Another DB

A bespoke system had been created for a client, and due to the demands on the single developer that had produced the solution, I recommended a more robust and well known solution, in this case Magento.

It was necessary to recreate all of the the existing customers in the Magento DB, so an understanding of how the database hangs together was required.

When a typical customer creates an account 2 tables appear to be updated in the customer tables, these are:
customer_entity
customer_entity_varchar

Typical values that can be seen will be something like:
customer_entity
entity_id: 1
entity_type_id: 1
attribute_set_id: 0
website_id: 1
email:
group_id: 1
increment_id: NULL
store_id: 1
created_at:
updated_at:
is_active: 1
disable_auto_group_change: 0

customer_entity_varchar
value_id: 1
entity_type_id: 1
attribute_id: 5
entity_id: 1
value:

value_id: 2
entity_type_id: 1
attribute_id: 7
entity_id: 1
value:

value_id: 3
entity_type_id: 1
attribute_id: 12
entity_id: 1
value:

value_id: 5
entity_type_id: 1
attribute_id: 3
entity_id: 1
value: ‘Default Store View’

However, how do we enter the password hash for the existing customer, as the value can be seen to consist of value similar to: c83bb10f066c20a2beb7c120cec5d003:VX
This value is defined by the MD5 encryption combined with a salt value. However, Magento will happily work with the MD5 value as a start point and then wen the customer updates the password then it will add the salt to the string for enhanced security.

Hope that helps.

Leave a Reply

Your email address will not be published. Required fields are marked *