I want to get my all customer information i want to just export all table my table and install in other site but both version are not same new site is in it can may be problematic ?and which table are related to customer information so i can be do my stuff


1 Answer 1

$collection = Mage::getResourceModel('customer/customer_collection')
               ->joinAttribute('billing_street', 'customer_address/street', 'default_billing', null, 'left')
               ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
               ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
               ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
               ->joinAttribute('billing_fax', 'customer_address/fax', 'default_billing', null, 'left')
               ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
               ->joinAttribute('billing_country_code', 'customer_address/country_id', 'default_billing', null, 'left')

               ->joinAttribute('shipping_street', 'customer_address/street', 'default_shipping', null, 'left')
               ->joinAttribute('shipping_postcode', 'customer_address/postcode', 'default_shipping', null, 'left')
               ->joinAttribute('shipping_city', 'customer_address/city', 'default_shipping', null, 'left')
               ->joinAttribute('shipping_telephone', 'customer_address/telephone', 'default_shipping', null, 'left')
               ->joinAttribute('shipping_fax', 'customer_address/fax', 'default_shipping', null, 'left')
               ->joinAttribute('shipping_region', 'customer_address/region', 'default_shipping', null, 'left')
               ->joinAttribute('shipping_country_code', 'customer_address/country_id', 'default_shipping', null, 'left')
               ->joinAttribute('taxvat', 'customer/taxvat', 'entity_id', null, 'left');

Or if you want via mysql query:

SELECT ce.*, ea.attribute_code, 
    CASE ea.backend_type 
       WHEN 'varchar' THEN ce_varchar.value
       WHEN 'int' THEN ce_int.value
       WHEN 'text' THEN ce_text.value
       WHEN 'decimal' THEN ce_decimal.value
       WHEN 'datetime' THEN ce_datetime.value
       ELSE NULL
    END AS value
  FROM customer_entity AS ce 
  LEFT JOIN eav_attribute AS ea ON ce.entity_type_id = ea.entity_type_id
  LEFT JOIN customer_entity_varchar AS ce_varchar ON ce.entity_id = ce_varchar.entity_id AND ea.attribute_id = ce_varchar.attribute_id AND ea.backend_type = 'varchar'
  LEFT JOIN customer_entity_int AS ce_int ON ce.entity_id = ce_int.entity_id AND ea.attribute_id = ce_int.attribute_id AND ea.backend_type = 'int'
  LEFT JOIN customer_entity_text AS ce_text ON ce.entity_id = ce_text.entity_id AND ea.attribute_id = ce_text.attribute_id AND ea.backend_type = 'text'
  LEFT JOIN customer_entity_decimal AS ce_decimal ON ce.entity_id = ce_decimal.entity_id AND ea.attribute_id = ce_decimal.attribute_id AND ea.backend_type = 'decimal'
  LEFT JOIN customer_entity_datetime AS ce_datetime ON ce.entity_id = ce_datetime.entity_id AND ea.attribute_id = ce_datetime.attribute_id AND ea.backend_type = 'datetime'
  • i just want table name ...
    – Yogesh
    Jun 12, 2014 at 5:06
  • Updated the answer Jun 12, 2014 at 5:12
  • Can it be right approach to direct import in new one and it can be create problem ? because older version is and new one is
    – Yogesh
    Jun 12, 2014 at 5:15
  • You mean upgrade magento, if yes you should probably go with magento standards Jun 12, 2014 at 5:17
  • not for upgrade i create another website and i want to get all customer list from another site.
    – Yogesh
    Jun 12, 2014 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.