1

while data:migration i get error

Base table or view not found: 1146 Table customer_entity_static 

But there is no table with this name. Does anyone had similar problem with this table?

Source: magento 1.9.3.4 Destination: magento 2.4.1

Thanks in advance :)

2 Answers 2

0

That table is not a built in Magento table, it was installed via extension or by your own custom code. You can figure out what module installed it in your Magento 1 installation by searching your project's config.xml files for the one that defines the customer_entity_static table. In order to get past the error you have two options:

  1. Install the Magento 2 version of that extension in your 2.4.1 installation, which will create the table for you so you can migrate data to it
  2. Update your data-migration-tool to ignore that table so nothing tries to migrate to it
5
  • Thanks for response. I searched magento 1 code and didn't find customer_entity_static. I also add this table to <ignore> but this didn't help. Problem is that magento do the select query on this table. And please note, that this table did not exist in M1 db
    – SebastianT
    Commented Mar 16, 2021 at 14:24
  • So just to clarify, the customer_entity_static table doesn't exist in your M1 db and is not defined in your M1 app/code/local or app/code/community directories? As for the <ignore> did you put it in your map.xml (map.xml.dist) file under <document_rules>? Commented Mar 16, 2021 at 15:11
  • You are correct. There is no table in db, there is no customer_entity_static in code folder and i also added this table in map.xml. This is super strange.
    – SebastianT
    Commented Mar 17, 2021 at 9:00
  • Super strange indeed...Is it possible customer_entity_static got defined in one of your mapping files somehow? Commented Mar 17, 2021 at 11:46
  • I searched for customer_entity_static in my M2 code and also in M1 code. I found nothing. Have no idea where the problem is. I will dig into it, and if i find something i will post answer here.
    – SebastianT
    Commented Mar 17, 2021 at 12:39
0

So, i found solution for this problem. The real problem is with custom customer attribute. Magento refers to table using attribute type. Check /vendor/magento/data-migration-tool/src/Migration/Step/Customer/Model/AttributesDataToCustomerEntityRecords.php. There is method called updateCustomerEntities which call fetchAttributesData. Last parameter is array with attributes backend_type. I have in this table static backend_type (for now, i don't know why i have this in array).
To find out which attribute cause the problem you can debug updateCustomerEntities method. Just put

var_dump($attributeCodesById);
var_dump($attributeIdsByType);
die;

after foreach loop

foreach ($attributeCodes as $attributeCode) {
 $eavAttributes = $this->entityTypeCode->getAttributesData($entityTypeCode);
 if (is_array($eavAttributes) && isset($eavAttributes[$attributeCode])) {
    $attributeId = $eavAttributes[$attributeCode]['attribute_id'];
    $attributeBackendType = $eavAttributes[$attributeCode]['backend_type'];
    $attributeIdsByType[$attributeBackendType][] = $attributeId;
    $attributeCodesById[$attributeId] = $attributeCode;
    }
}

and run migrate:data. In first array you will get table with attributes where key is attribute id, and value is attribute code.
In second array you will have attributes types (as key) and attributes ids (as value). In my case in static i have one attribute. This attribute gives problem.

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.