OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform Is there a hard reset of ALL caches (in files, databases, config)?

This topic contains 7 replies, has 3 voices, and was last updated by  Andrey Yatsenko 5 years, 11 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #37133

    spyout98
    Participant

    Is there a hard reset of ALL caches (in files, databases, config) that could exist in OroPlatform or OroCRM?

    If not, how do I hard reset ALL caches that can possibly exists in Oro?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #37134

    spyout98
    Participant

    I want to do this because I have an Entity placed in namespace “MyBundle/Entity”. But I moved the class to another bundle namespace “MyAnotherBundle/Entity” and I changed all my PHP code to get the new namespace (the ‘use’ imports in each file and the ‘.yml’ config files).

    But when I try to up the server or clear cache of Oro (php app/console cache:clear), appears a message like “Target entity class ‘MyEntity’ could be found in ‘MyBundle/Entity/'”.

    How do I hard reset EVERYTHING that Oro can possibly cache?

    #37135

    spyout98
    Participant

    ?

    #37136

    Andrey Yatsenko
    Moderator

    Hi spyout98,

    It’s not just about cache. Unfortunately the configuration already loaded to the database and you already have links to that entity class in some places of the system, like workflow, search, migrations, navigation, acl and so on.

    We had similar case when migrated entities from OroCRM to Oro namespaces. For that migration we used cache warmer that was triggered during platform update, there is a separate command created for that purpose, named oro:platform:upgrade20:db-configs

    The command loads services registered with tag oro_installer.namespace_migration_provider

    For example you can check https://github.com/oroinc/crm/blob/2.6.1/src/Oro/Bundle/CRMBundle/Cache/NamespaceMigrationProvider.php

    Probably you can create your own namespace migration provider with specifying in $additionConfig property what should be replaced to what.
    After running command all usage places should be updated.

    #37137

    spyout98
    Participant

    Could you make a simple example about how do I do this in my custom bundle?

    For example:

    If I have a ‘MyBundle’ bundle already installed in Oro. So, I should create a file placed in ‘[my-orocrm-path]/src/MyBundle/Cache/NamespaceMigrationProvider.php’. The content of this file should be something like this below:

    After, I have to create the ‘[my-orocrm-path]/src/MyBundle/Resources/config/services.yml’, with its content:

    Once created these files, how do I execute it? Is there some command in terminal for it?

    #37138

    Michael
    Keymaster

    By the way, if we are talking about the local development environment here – then re-installation from scratch will be much faster solution. 5 minutes – and you are done.

    #37139

    spyout98
    Participant

    This system is already in production. I can’t just reinstall. That’s why I need a example code for this.

    #37140

    Andrey Yatsenko
    Moderator

    The command name is ‘oro:platform:upgrade20:db-configs’
    But makesure you made database dump before running it

Viewing 7 replies - 1 through 7 (of 7 total)

The forum ‘OroPlatform’ is closed to new topics and replies.

Back to top