cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrading from 2.2 to 2.3 error

SOLVED

Upgrading from 2.2 to 2.3 error

Hey,

 

I created a new installation of a Magento 2.3.5-p2 and I want to use or get the data from a database that were used in a Magento 2.2 installation.

I corrected the type from some tables that could not be enum that's fine but then this appears when I run setup:upgrade

 

Notice: Undefined index: CUST_pecustomer_entity in /var/www/webroot/ROOT/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

And idk what to do, it doesn't seem to be an old extension problem that's a core table that's why I'm kinda lost here.

Any solution for this?

 

Thanks Smiley Very Happy

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Upgrading from 2.2 to 2.3 error

I got it

 

I had to debug, I think that should be already there, the error ir gives by default it's not that helpful tbh but I resolved by adding in 

 

vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php

 

in line 148 do this

 

//Prepare reference data
                $referenceData['table'] = $table;
                $referenceTableName = $referenceData['referenceTable'];
                $referenceData['column'] = $table->getColumnByName($referenceData['column']);
              	if(!isset($this->tables[$referenceTableName])){
                	var_dump($tableName);exit;
                }
                $referenceData['referenceTable'] = $this->tables[$referenceTableName];
                $referenceData['referenceColumn'] = $referenceData['referenceTable']->getColumnByName(
                    $referenceData['referenceColumn']
                );

 

it returns the table that's giving errors, it was a foreign key in a table created by an old extension, I would never find that with just the default message, hope it can help someone. 

 

 

Thanks everyone Smiley Very Happy

View solution in original post

6 REPLIES 6

Re: Upgrading from 2.2 to 2.3 error

Hi @rui_silva1,

 

Can you please check in your database if you have used 

CUST_pecustomer_entity

term anywhere in eav tables. If yes, then try to remove this from your database.

 

Thanks!

Problem Solved! Click Kudos & Accept as Solution. 

Re: Upgrading from 2.2 to 2.3 error

Hey @Nishu Jindal ,

 

Thanks for the answer.

I searched for 

CUST_pecustomer_entity

and

pecustomer_entity

 and only found a result customer_entity the last one on eav_entity_type but it isn't CUST_pecustomer_entity.

 

Did missed something?

 

Thanks Smiley Very Happy

Re: Upgrading from 2.2 to 2.3 error

Hi @rui_silva1 

 

This will be because Magento_Search is turned off. You can get passed this error by enable the mobile in app/etc/config.php change the line:

'Magento_Search' => 0

to

'Magento_Search' => 1

 It may help you to resolve issue.

If issue resolve please click on 'Kudos' & Accept as Solution!

Problem solved? Click Accept as Solution!

Re: Upgrading from 2.2 to 2.3 error

Hey @Bhanu Periwal,

 

I checked and it is already at 

 

'Magento_Search' => 1

 

Thanks Smiley Very Happy 

Re: Upgrading from 2.2 to 2.3 error

I got it

 

I had to debug, I think that should be already there, the error ir gives by default it's not that helpful tbh but I resolved by adding in 

 

vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php

 

in line 148 do this

 

//Prepare reference data
                $referenceData['table'] = $table;
                $referenceTableName = $referenceData['referenceTable'];
                $referenceData['column'] = $table->getColumnByName($referenceData['column']);
              	if(!isset($this->tables[$referenceTableName])){
                	var_dump($tableName);exit;
                }
                $referenceData['referenceTable'] = $this->tables[$referenceTableName];
                $referenceData['referenceColumn'] = $referenceData['referenceTable']->getColumnByName(
                    $referenceData['referenceColumn']
                );

 

it returns the table that's giving errors, it was a foreign key in a table created by an old extension, I would never find that with just the default message, hope it can help someone. 

 

 

Thanks everyone Smiley Very Happy

Re: Upgrading from 2.2 to 2.3 error

For anybody trying to find this and struggling

 I was getting this error 

Notice: Undefined index: catalog_product_entity in public/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 153

adding this debug code to the schmebuilder.php worked for me. I knew I'd seen it before but had to do some creative googling to find it.  Hopefully, it will show up for others.

 

This was happening when running setup:upgrade for me after installing a plugin

Chris @ Rixxo
Magento Solution Specialist, 10 year Magento user, store owner and Agency Director