Question

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 :)

Was it helpful?

Solution

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.

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top