How can one installation package replace another without uninstalling and reinstalling?

How can one installation package replace another without uninstalling and reinstalling?

We want to use packages to make changes to Sugar instead of studio.  That way we can track the changes in GITHUB.

  • For such cases I just keep the id and name of the package unchanged and increase the version number.

    e.g. if the base package has:

    $manifest = array(

    'name' => 'myPackage',

    'version => '202008100001'.

    ...);

    $installdefs =array(

    'id' => 'myPackage',

    ...);

    I'll set the next package to:

    'version => '202008100002'.

    BUT BE AWARE, when doing so you cannot uninstall that package any more, the UNINSTALL button will disappear in module loader.

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

  • If you're using Github already, another alternative to consider is using Pull Requests. Using packages might become cumbersome if there are multiple packages affecting the same file. 

    We had a similar situation for one of our clients, and we moved to Pull Requests - and that worked like a charm. The developer creates a new feature branch, commits their code there, and creates pull requests. For vendors, we can ask them to fork the repository and create pull requests out of it.

  • Good answers.

    About the pull request.  That is what we use now, but we are talking about being able to go to the cloud.   Do you know a way to do that via cloud?

  • Good answers.

    About the pull request.  That is what we use now, but we are talking about being able to go to the cloud.   Do you know a way to do that via cloud?

  • It there a way to make the old version disappear?

  • Since 10.x sugar has an api to install packages. Maybe it is possible with a githook to create a package and install it on the desired instance?

  • If you do not want to uninstall/reinstall, the version number change is the best option whether you do it manually or use the API. I prefer to uninstall/reinstall to make sure any files that might have been removed from later versions are removed.

  • Amy,

    I am going to give you some additional food for thought.

    The reason why it would be normally better (with some caveats) to uninstall the original module first, and then install the new version, is so that if the old version contained a file which is no longer there on the new package, the actual no longer needed file is removed. Otherwise it will stay there forever as other "Sugar Clubbers" correctly mentioned.

    The caveats on why you would not uninstall a module at times are:

    • if the module would uninstall any required data (there are options to not do that, but if they have not been activated, it could be disruptive)
    • if the vendor that built the module let you know to not uninstall the module

    Hope it helps thinking the overall deployment process through

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  • The module loader shows only the latest version in its list when you keep name and id unchanged.

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH