symfonypimcore

migrate-naming-strategy not working in Pimcore 6.9


I have a Pimcore instance v 6.9. with editables naming strategy set to legacy:

pimcore:
    documents:
        editables:
            naming_strategy: legacy

I would like to upgrade to 10.x for which the requirement is to use nested naming strategy, but when running console command bin/console pimcore:documents:migrate-naming-strategy to convert naming strategy to nested there is an error:

The migration strategy "render" does not exist

I looked into code and the problem seems to be that command can't fetch requested service from Symfony container:

$strategyId = 'pimcore.document.tag.naming.migration.strategy.render';
$container->has($strategyId)

I have tried making making service pimcore.document.tag.naming.migration.strategy.render in Symfony container as public, but this didn't solve the issue.

I have also tried to downgrade Pimcore to lover versions but the result is same.

How can I mitigate this issue?


Solution

  • For us this worked at Pimcore 6.9.6 by adding the following lines from https://github.com/pimcore/pimcore/blob/v5.8.9/bundles/CoreBundle/Resources/config/documents.yml to our services.yml below services:

    #
    # DOCUMENT TAG MIGRATION
    #
    
    pimcore.document.tag.naming.migration.strategy.analyze:
        public: true
        class: Pimcore\Document\Tag\NamingStrategy\Migration\AnalyzeMigrationStrategy
        arguments:
            $db: '@database_connection'
    
    pimcore.document.tag.naming.migration.strategy.render:
        public: true
        class: Pimcore\Document\Tag\NamingStrategy\Migration\RenderMigrationStrategy
    
    # the used naming strategy will be aliased to "pimcore.document.tag.naming.strategy" by the extension based on
    # the pimcore.documents.editables.naming_strategy config value
    Pimcore\Document\Tag\NamingStrategy\NamingStrategyInterface: '@pimcore.document.tag.naming.strategy'
    
    pimcore.document.tag.naming.strategy.legacy:
        public: true
        class: Pimcore\Document\Tag\NamingStrategy\LegacyNamingStrategy
    
    pimcore.document.tag.naming.strategy.nested:
        public: true
        class: Pimcore\Document\Tag\NamingStrategy\NestedNamingStrategy