What is PHP 8.2 upgrade?
SugarCRM periodically updates the set of supported platforms for running Sugar Enterprise, and Sugar Sell & Sugar Serve in our cloud. Upgrading supported platforms improve the performance and security of Sugar applications that run on top of them. Shortly, SugarCloud will be updating its PHP version from 7.4 to 8.2. This means any PHP code running in the SugarCloud, including customizations built by customers or partners, will need to be modified to support PHP 8.2.
Why are we upgrading PHP?
It is crucial that we upgrade our cloud stacks to ensure we are running on supported software versions adhering to security best practices. PHP 7.4 has reached its end-of-life, and PHP 8.0 is no longer actively supported, therefore Sugar has decided to upgrade to PHP 8.2, the latest supported version.
For more detailed information regarding PHP support, please refer to the PHP community’s Supported Versions documentation.
Who is affected by this upgrade?
Moving from PHP 7.4 to 8.2 introduces improvements and some breaking changes to the PHP language. In short, some PHP code that works in the current PHP 7.4 environment will break when run in PHP 8.2. The SugarCloud operations team, in collaboration with the engineering team, has conducted a comprehensive Rector scan to identify potential incompatibilities in Sugar instances across our entire SugarCloud environment. This scan has provided valuable insights into how customers and partners are customizing Sugar.
We have conducted a thorough scan for PHP 8.2 compatibility on all Sugar instances. The purpose of the scan was to ensure that the PHP code in these instances are already compatible with PHP 8.2. It identified customizations that range from overriding core code to utilizing PHP libraries that are incompatible with PHP 8.2.
It's important to note that our scan excluded cosmetic (non-breaking) changes from PHP 7.4 to 8.2.
After conducting a scan of our SugarCloud environment, the SugarOutfitters team identified add-ons that are incompatible with PHP 8.2. It's important to note that this identification process has been carried out using regular expressions (regex scripts) and may not be as comprehensive or accurate as Rector. Nevertheless, it is allowing us to proactively reach out to the affected ISV partners so they can promptly address PHP 8.2 compatibility issues.
Sugar Enterprise 13.0 adds support for PHP 8.2. While it is strongly advised customers to upgrade their on-premise platforms to use PHP 8.2 as soon as possible. The timeline to upgrade your environments and customizations ultimately rests with you and your IT team. Make sure they are aware of the risks and consequences of running on unsupported versions of PHP.
When is this happening (plan and timeline)?
SugarCloud will begin upgrading environments to PHP 8.2 in July 2023. The goal is to upgrade all our cloud stacks (clones, sandboxes, and production) by the end of 2023. In the context of Sugar, a cloud stack refers to the virtualized hardware on which instances run within each of our hosting regions.
For this to happen, Sugar has put a high-level plan and is currently working on refining the details, however, we count on our developer and partner community to make this plan a reality. The plan includes the following steps:
- Upgrade all instances to Sugar 13.0 or later
- Provide PHP 8.2 clone/sandbox stack for partners to restore backups to and test their customizations
- Upgrade clone/sandbox Stacks that do not contain PHP 8.2 incompatible instances
- Proceed with upgrading production stacks in each region
It is crucial to emphasize that once a stack is upgraded, all Sugar instances within that stack will be running PHP 8.2. It is not possible to opt out of the PHP 8.2 upgrade.
What will happen during/after upgrade?
Upgrading PHP version will not change any files in your Sugar instance. It will change how the PHP code in your instance is executed. If any incompatible PHP code exists, it will result in a PHP runtime error when executed using the new PHP 8.2 interpreter.
If these runtime errors occur during a user interface (UI) interaction, users may encounter UI errors. However, if the error happens in server-side code, logic hooks, jobs, APIs, or other components, it may not be easily identifiable unless you periodically check PHP error log using SugarCloud Insights.
For those who sell add-ons through SugarOutfitters, it is important to note that if an add-on is not compatible with PHP 8.2, it may not function properly or fail to install properly or later when users attempt to use affected functionality.
What action do I need to take?
You must test your customizations and add-ons using a PHP 8.2 environment to ensure they continue to function as intended. This includes conducting comprehensive testing of your server-side code, as it often contains significant portions written in pure PHP.
Consider planning a dry-run of Rector on your customizations. This process will not modify any files in your file system but will provide a list of breaking changes and suggestions on how to address them, similar to a
If your customization “writes PHP files to filesystem”, ensure it creates PHP 8.2 compatible code. It will not be available at the time of scans and/or when you scan with Rector.
By conducting thorough testing, utilizing tools like Rector, and ensuring PHP 8.2 compatibility in your customizations, you can address potential issues and ensure a smooth transition to the upgraded environment.
Is there a tool that can help me keep my code compatible?
Absolutely yes! That is exactly how Sugar maintains compatibility across multiple PHP versions. We leverage the power of Rector, an open-source project that can automatically detect and make your code compatible on your behalf.
For all the detailed information and instructions, please refer to the comprehensive guide available at the following link: Automated PHP Compatibility Tool Guide.