cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Customer CSV Import trouble

Magento 2 Customer CSV Import trouble

Using Magento community 2.2.7.   I'm attempting to import customers from a CSV generated from a previous version.  I massaged the CSV to match the example from the new version and after a few iterations was able to validate the data.  The trouble is that when I try to run the import it just says 'Please wait' and spins forever.  I can see in the history that the import started and the status is 'Processing', but no customers have been imported.  There are no errors to the screen or to any of the logs that I've been able to find, just the infinite loading indicator.  I'm new to Magento so I'm looking for help in debugging this further.  I have pared the import file down to a single record and have the same problem. I tried to paste that row below with data obfuscated.  Thanks!

 

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 website_id wholesale_qualified password _address_city _address_company _address_country_id _address_firstname _address_lastname _address_postcode _address_prefix _address_region _address_street _address_suffix _address_telephone _address_vat_id _address_default_billing_ _address_default_shipping_ test@aol.com base admin   2019-03-03 22:51:25 Store View 0   Foo   1 Bar   50becaafddf40ab83Smiley FrustratedOvXtL2yG4aG8bIN6b       1     1 NO   Jacksonville   US Foo Bar 62650   Illinois 104 My Ct   2171112222   1 1

1 REPLY 1

Re: Magento 2 Customer CSV Import trouble

After a little bit of digging I did find the following:

Uncaught Error: Call to a member function getBackendModel() on null in /home/shopbluethumb/public_html/vendor/magento/module-customer-import-export/Model/Import/Customer.php:442

 

and after some trial and error it seems that this is directly related to custom customer attributes.  If I turn off validation and exclude them from the csv the import works.  Of course I want to import them.  The custom attributes are defined and populated for other customers already in the new database.  In the customer import model they are defined in the attributes array (referenced above) like this example, but

 

$attribute = $this->_customerModel->getAttribute($attributeCode);

 

is returning null.

 

[companyposition] => Array
       (
           [id] => 152
           [code] => companyposition
           [table] => mag_customer_entity_varchar
           [is_required] => 0
           [is_static] =>  
           [rules] =>  
           [type] => varchar
           [options] => Array
               (
               )

       )

suggestions?