5

I upgraded (via composer.phar update) from beta6 to RC. When running php bin/magento setup:upgrade I am getting the following error now:

[...]
Data install/update:
Module 'Magento_Store':
Module 'Magento_AdvancedPricingImportExport':
Module 'Magento_Directory':
Module 'Magento_Theme':
Module 'Magento_Backend':
Module 'Magento_Backup':
Module 'Magento_Eav':
Module 'Magento_Customer':
Upgrading data.. 


    [ReflectionException]                                                      
    Class Magento\Customer\Model\Resource\Attribute\Collection does not exist  

After the DB Update (see partial solution) I get:

Upgrading data..

[ErrorException]     
Undefined offset: 1  

With the -vvvv option:

Exception trace:
 () at /home/self/example/workspace/example.de/vendor/magento/module-customer/Setup/UpgradeData.php:335
 Composer\Util\ErrorHandler::handle() at /home/self/example/workspace/example.de/vendor/magento/module-customer/Setup/UpgradeData.php:335
 Magento\Customer\Setup\UpgradeData->upgradeHash() at /home/self/example/workspace/example.de/vendor/magento/module-customer/Setup/UpgradeData.php:232
 Magento\Customer\Setup\UpgradeData->upgrade() at /home/self/example/workspace/example.de/setup/src/Magento/Setup/Model/Installer.php:786
 Magento\Setup\Model\Installer->handleDBSchemaData() at /home/self/example/workspace/example.de/setup/src/Magento/Setup/Model/Installer.php:746
 Magento\Setup\Model\Installer->installDataFixtures() at /home/self/example/workspace/example.de/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php:72
 Magento\Setup\Console\Command\UpgradeCommand->execute() at /home/self/example/workspace/example.de/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /home/self/example/workspace/example.de/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /home/self/example/workspace/example.de/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /home/self/example/workspace/example.de/vendor/magento/framework/Console/Cli.php:49
 Magento\Framework\Console\Cli->doRun() at /home/self/example/workspace/example.de/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /home/self/example/workspace/example.de/bin/magento:25
1

The table eav_entity_type contains old class names. Run the following SQL:

UPDATE eav_entity_type SET
    entity_model = REPLACE(entity_model, "Model\\Resource", "Model\\ResourceModel") ,
    attribute_model = REPLACE(attribute_model, "Model\\Resource", "Model\\ResourceModel"),
    entity_attribute_collection = REPLACE(entity_attribute_collection, "Model\\Resource", "Model\\ResourceModel")

For fixing the second Error I made a patch, which checks the current customer hash for null when upgrading.

https://github.com/magento/magento2/pull/2308

1

Resource was renamed to ResourceModel

Run:

START TRANSACTION; SET @from = '\\Resource\\'; SET @to = '\\ResourceModel\\'; UPDATE eav_attribute SET attribute_model = REPLACE(attribute_model, @from, @to); UPDATE eav_attribute SET backend_model = REPLACE(backend_model, @from, @to); UPDATE eav_attribute SET source_model = REPLACE(source_model, @from, @to); UPDATE eav_entity_type SET entity_model = REPLACE(entity_model, @from, @to); UPDATE eav_entity_type SET attribute_model = REPLACE(attribute_model, @from, @to); UPDATE eav_entity_type SET entity_attribute_collection = REPLACE(entity_attribute_collection, @from, @to); COMMIT;

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