Difference between revisions of "Legacy Module Removal"

From WHMCS Documentation

m
(Handling a Failed Removal)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<div class="docs-alert-info"><i class="fa fa-question-circle"></i> This page describes a feature available in version 7.5 and above.</div>
 
<div class="docs-alert-info"><i class="fa fa-question-circle"></i> This page describes a feature available in version 7.5 and above.</div>
<div class="docs-alert-warning"><i class="fa fa-exclamation-circle"></i> If you were directed to this page via an email notification, then please refer to the [[Legacy_Module_Removal:Handling Notifications|Handling Notifications]] section.</div>
+
<div class="docs-alert-warning"><i class="fa fa-exclamation-circle"></i> If you were directed to this page via an email notification, then please refer to the [[#Handling Notifications|Handling Notifications]] section.</div>
  
Old PHP code may introduce breakage on newer versions of PHP runtime. In order to protect your system from unexpected downtime, WHMCS 7.5 will perform an inspection for any unused legacy modules. Legacy modules are modules that are no longer maintained or distributed and are typically for older and often discontinued services.
+
Old PHP code may introduce breakage on newer versions of PHP runtime. In order to protect your system from unexpected downtime, WHMCS 7.5 and newer will perform an inspection for any unused legacy modules. Legacy modules are modules that are no longer maintained or distributed and are typically for older and often discontinued services.
  
 
__TOC__
 
__TOC__
Line 12: Line 12:
 
Following the inspection WHMCS will attempt to perform outdated module deletion. There may be three possible outcomes:
 
Following the inspection WHMCS will attempt to perform outdated module deletion. There may be three possible outcomes:
  
# A legacy module is found to be unused and is successfully deleted. A log entry will be created. No email will be sent.
+
# A legacy module is found to be unused and is successfully deleted. A log entry starting with "Unused legacy modules were deleted" will be created, and will contain a comma separated list of the modules that were deleted. An email message will be sent to notify system administrators of the modules that were deleted.
# A legacy module is found to be in use and is not attempted for deletion. A log entry will be created. An email message will be sent to notify system administrators of this condition.
+
# A legacy module is found to be in use and is not attempted for deletion. A log entry starting with "One or more legacy modules were found to be in use and were not attempted to be deleted" will be created, and will contain a comma separated list of the modules that were unable to be deleted. An email message will be sent to notify system administrators of this condition.
# A legacy module is found to be unused and deletion is attempted, but the deletion fails (e.g. due to insufficient permissions or a filesystem issue). A log entry will be created. An email message will be sent to notify system administrators of this condition.
+
# A legacy module is found to be unused and deletion is attempted, but the deletion fails (e.g. due to insufficient permissions or a filesystem issue). A log entry starting with "One or more legacy modules could not be deleted" will be created, and will contain a comma separated list of the modules that were unable to be deleted. An email message will be sent to notify system administrators of this condition.
  
 
== Handling Notifications ==
 
== Handling Notifications ==
Line 24: Line 24:
  
 
Once all modules in the received email have been addressed, either by manual deletion or by contacting the module author, then we would recommend using the [[PHP_Version_Compatibility_Assessment|PHP Version Compatibility Assessment utility]] to help locate any other files that may negatively affect WHMCS.
 
Once all modules in the received email have been addressed, either by manual deletion or by contacting the module author, then we would recommend using the [[PHP_Version_Compatibility_Assessment|PHP Version Compatibility Assessment utility]] to help locate any other files that may negatively affect WHMCS.
 +
 +
==Handling a Failed Removal==
 +
 +
If removal fails, you will see the following message in an email notification or in the '''Activity Log''' at '''Configuration (<i class="fa fa-wrench"></i>) > [[System Logs]]''' or, prior to WHMCS 8.0, '''Utilities > Activity Log''':
 +
 +
<div class="source-cli">
 +
A recent WHMCS update failed to remove legacy modules. These modules may cause
 +
<br/>negative behavior if you upgrade PHP and leave them on the system.
 +
<br/><br/>We recommend working to remove them manually.
 +
</div>
 +
 +
This typically occurs due to one of the following reasons:
 +
* The '''Automatic Updater''' utility detected that the module is currently active and configured in WHMCS. Because of this, the system treated the module as being in use.
 +
* The '''Automatic Updater''' utility could not delete the module's files due to permission restrictions.
 +
 +
If this occurs, you will need to remove the affected modules manually. The method to do this depends on the type of module. For more information, see [https://help.whmcs.com/m/updating/l/850628-troubleshooting-a-failed-to-remove-legacy-modules-error Troubleshooting A Failed to remove legacy modules Error].

Latest revision as of 20:01, 1 November 2022

This page describes a feature available in version 7.5 and above.
If you were directed to this page via an email notification, then please refer to the Handling Notifications section.

Old PHP code may introduce breakage on newer versions of PHP runtime. In order to protect your system from unexpected downtime, WHMCS 7.5 and newer will perform an inspection for any unused legacy modules. Legacy modules are modules that are no longer maintained or distributed and are typically for older and often discontinued services.

Inspection Process

During updates, WHMCS will check for modules that are no longer officially maintained or supported. If a module is activated and configured then that module will be considered to be in use, and WHMCS will not attempt to delete that module.

Deletion & Notification Process

Following the inspection WHMCS will attempt to perform outdated module deletion. There may be three possible outcomes:

  1. A legacy module is found to be unused and is successfully deleted. A log entry starting with "Unused legacy modules were deleted" will be created, and will contain a comma separated list of the modules that were deleted. An email message will be sent to notify system administrators of the modules that were deleted.
  2. A legacy module is found to be in use and is not attempted for deletion. A log entry starting with "One or more legacy modules were found to be in use and were not attempted to be deleted" will be created, and will contain a comma separated list of the modules that were unable to be deleted. An email message will be sent to notify system administrators of this condition.
  3. A legacy module is found to be unused and deletion is attempted, but the deletion fails (e.g. due to insufficient permissions or a filesystem issue). A log entry starting with "One or more legacy modules could not be deleted" will be created, and will contain a comma separated list of the modules that were unable to be deleted. An email message will be sent to notify system administrators of this condition.

Handling Notifications

Want a walk through? Check out our Guides and Tutorials page on this topic!

Should you receive an email concerning legacy modules found to be in use, then the recommended action is to contact the module author and determine if there is an update available for the module in question.

Should you receive an email concerning unused legacy modules that were not able to be deleted, then it is recommended to investigate and finalize module removal manually as the module state may be inconsistent due to potentially partial deletion.

Once all modules in the received email have been addressed, either by manual deletion or by contacting the module author, then we would recommend using the PHP Version Compatibility Assessment utility to help locate any other files that may negatively affect WHMCS.

Handling a Failed Removal

If removal fails, you will see the following message in an email notification or in the Activity Log at Configuration () > System Logs or, prior to WHMCS 8.0, Utilities > Activity Log:

A recent WHMCS update failed to remove legacy modules. These modules may cause
negative behavior if you upgrade PHP and leave them on the system.

We recommend working to remove them manually.

This typically occurs due to one of the following reasons:

  • The Automatic Updater utility detected that the module is currently active and configured in WHMCS. Because of this, the system treated the module as being in use.
  • The Automatic Updater utility could not delete the module's files due to permission restrictions.

If this occurs, you will need to remove the affected modules manually. The method to do this depends on the type of module. For more information, see Troubleshooting A Failed to remove legacy modules Error.