Search code examples
orocrm

ORO MIgration from 3.1.19 to 4.1.2


We are migrating from ORO 3.1.19 to 4.1.2 and we are having issues with the migrations.

$ php bin/console --env=prod oro:migration:load --force --show-queries
Process migrations...
  > Oro\Bundle\EntityExtendBundle\Migration\LoadEntityConfigStateMigration
  > Oro\Bundle\MigrationBundle\Migration\UpdateBundleVersionMigration
  > Oro\Bundle\EntityExtendBundle\Migration\RefreshExtendCacheMigration

    Prepare entity config
    Clear extended entity cache
    Dump the configuration of extended entities to the cache
    Clear entity metadata cache
    Warm   up entity metadata cache

    In RuntimeReflectionService.php line 63:

    Property Oro\Bundle\AttachmentBundle\Entity\Attachment::$account_8d93c122 does not exist

We tried to clear the cache, entity-config cache and no success

 php bin/console --env=prod oro:entity-config:cache:clear
 php bin/console --env=prod oro:entity-config:cache:warmup

Any help or feedback would be greatly appreciated.

Thanks

EDIT

We can see that the Attachment::$account_8d93c122 is found by the Reflection during the initial container creation, but not during the entity-cache warmup


Solution

  • The solution/workaround was to run oro:entity-extend:cache:check before the cache clear

    class RefreshExtendCacheMigrationQuery {
    // ....
        public function execute(LoggerInterface $logger)
        {
            $this->commandExecutor->runCommand(
                'oro:entity-extend:cache:check',
                [],
                $logger
            );
    
            $this->commandExecutor->runCommand(
                'oro:entity-extend:cache:clear',
                [],
                $logger
            );
        }
    }