Difference between revisions of "Automatic Updater"

From WHMCS Documentation

m (Reverted edits by John (talk) to last revision by SarahK)
Line 2: Line 2:
  
 
The Automatic Update utility allows admin users to update WHMCS quickly and easily in just a few clicks.
 
The Automatic Update utility allows admin users to update WHMCS quickly and easily in just a few clicks.
 +
 +
You can access this feature at '''Utilities > Update WHMCS'''.
 +
 +
For more information on the way in which updates change files, see [[Updater File Changes]].
  
 
== System Requirements ==
 
== System Requirements ==
Line 13: Line 17:
 
* PHP Zip Extension or the proc_open PHP function enabled
 
* PHP Zip Extension or the proc_open PHP function enabled
 
* PHP setting open_basedir to include entire WHMCS docroot
 
* PHP setting open_basedir to include entire WHMCS docroot
 
== Checking for Updates ==
 
 
New updates are checked for periodically automatically.
 
 
When an update becomes available, a notification will appear in the top left corner of admin area as shown below.
 
 
[[File:Screenshot 2017-06-01 10.32.27.png|700px]]
 
 
===Manually checking for updates===
 
 
You can check for updates on-demand by navigating to ''Utilities > WHMCS Update'' and clicking the '''Check for Updates''' button.
 
 
If a release has just been published you may need to do this to see the update as available prior to the next automated check.
 
 
[[File:UpdateAvailable.png|center]]
 
 
== Performing an Update ==
 
 
To perform an update, navigate to ''Utilities > Update WHMCS'' and click the '''Update Now''' button (pictured above).
 
 
<div class="docs-alert-info"><i class="fa fa-info-circle"></i> Please note this option will only show if an update is available based on your current Update Channel Preferences.</div>
 
 
You will then be guided through the update process.  The update process can take anywhere from 30 seconds to a few minutes to complete.
 
 
Before beginning any update, it is strongly recommended to make a full backup of your current installation and review the [[Release Notes]] for any important notices and information.
 
 
Watch our video tutorial here: https://vimeo.com/whmcs/automatic-updates-tutorial
 
 
<div class="docs-alert-success"><i class="fa fa-warning"></i> Your customisations will be preserved during the update provided you are leveraging the recommended methods for customising things such as [[Customising_the_Six_Theme|templates]], [[WHOIS_Servers|WHOIS servers]], [[Additional Domain Fields]] and [[Customising Countries and Calling Codes|Countries]]</div>
 
 
<div class="docs-alert-warning"><i class="fa fa-check"></i> If you have customised the permissions on any of the files eg. /crons/pipe.php. These changes will need to be re-applied after the upgrade is complete.</div>
 
  
 
== Configuring Your Update Settings ==
 
== Configuring Your Update Settings ==
Line 50: Line 22:
 
=== Choosing an Update Channel ===
 
=== Choosing an Update Channel ===
  
The WHMCS automatic updater allows you to choose an update channel that defines the type of updates you will receive.
+
The WHMCS automatic updater allows you to choose an update channel that defines the type of updates you will receive. The update channel setting determines the least stable version you are willing to update to:
 
 
For most users, we recommend choosing the '''Stable''' channel which will only apply Stable updates to your installation.
 
  
 
<table class="table table-striped">
 
<table class="table table-striped">
Line 61: Line 31:
 
<tr>
 
<tr>
 
<td>Stable</td>
 
<td>Stable</td>
<td>'''Recommended''' for most installations of WHMCS, the Stable channel will track the latest stable version that has been released.</td>
+
<td>'''Recommended''' for most installations of WHMCS, the Stable channel will only apply Stable updates to your installation.</td>
 +
</tr>
 +
<tr>
 +
<td>Current Version</td>
 +
<td>Subscribing to this channel will restrict you to only receiving maintenance updates for the major/minor version that is currently installed. For example if you are on a version that is in [[Long Term Support]] and a patch is issued for that series, this channel allows you to apply the patch and remain on that series.<div class="docs-alert-info">This is useful for applying minor updates and security releases. More details below.</div></td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 70: Line 44:
 
<td>Beta</td>
 
<td>Beta</td>
 
<td>Subscribing to the Beta release channel will allow you to receive the very latest versions of WHMCS. This tier should only be selected for development and test based installations.</td>
 
<td>Subscribing to the Beta release channel will allow you to receive the very latest versions of WHMCS. This tier should only be selected for development and test based installations.</td>
</tr>
 
<tr>
 
<td>Current Version</td>
 
<td>Subscribing to this channel will restrict you to only receiving maintenance updates for the major/minor version that is currently installed. For example if the installed version of WHMCS is 7.0.0-GA, admins will be offered upgrades to 7.0.1-GA and 7.0.2-GA, but not 7.1.0.</td>
 
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
 +
==== Patch and Maintenance Release Updates ====
 +
 +
* If you are on a version that is in [[Long Term Support]] and a patch is issued for that series, you can use the Updater to apply the patch and remain on that series.
 +
* To do this, select the '''Current Version''' update channel as described above.
 +
* You many need to click ''Check for Updates'' after any setting changes in order to refresh the available version displayed within the page.
 +
 +
<div class="docs-alert-warning">
 +
You may wish to change this setting back to "Stable" after updating to ensure future checks display the latest Active Development version available to you.
 +
</div>
  
 
=== Setting a Temporary Update Path ===
 
=== Setting a Temporary Update Path ===
Line 88: Line 68:
  
 
[[File:Configureupdatesettings.png|center]]
 
[[File:Configureupdatesettings.png|center]]
 +
 +
== Checking for Updates ==
 +
 +
New updates are checked for periodically automatically.
 +
 +
When an update becomes available, a notification will appear in the top left corner of admin area as shown below.
 +
 +
[[File:Screenshot 2017-06-01 10.32.27.png|700px]]
 +
 +
===Manually checking for updates===
 +
 +
You can check for updates on-demand by clicking the '''Check for Updates''' button.
 +
 +
If a release has just been published you may need to do this to see the update as available prior to the next automated check.
 +
 +
For Owned licenses, the version fetched by the utility will be the version of WHMCS that was available when your Support and Updates Subscription was active. Downloading the latest version of WHMCS requires an active Support and Updates Subscription.
 +
 +
[[File:UpdateAvailable.png|center]]
 +
 +
== Performing an Update ==
 +
 +
To perform an update:
 +
 +
# Make certain that your server meets the [[System_Requirements|system requirements]] and review the [[Release Notes]] for any important notices and information.
 +
# Make a full backup of your current installation.
 +
# In WHMCS, click '''Update Now'''. <div class="docs-alert-info"><i class="fa fa-info-circle"></i>This option only displays if an update is available for your current update channel.</div>
 +
# Follow the prompts to complete the update process. The update process can take anywhere from 30 seconds to a few minutes to complete.
 +
 +
If you have custom template files you will also need to review and make any necessary changes to your custom templates using the information provided in the Template Changes section of the [[Release_Notes|Release Notes]].
 +
 +
<div class="docs-alert-success"><i class="fa fa-warning"></i> Your customisations will be preserved during the update if you are leveraging the recommended methods for customising things such as [https://developers.whmcs.com/themes/ templates], [[WHOIS_Servers|WHOIS servers]], [[Additional Domain Fields]] and [[Customising Countries and Calling Codes|Countries]]</div>
 +
 +
<div class="docs-alert-warning"><i class="fa fa-check"></i> If you have customised the permissions on any of the files eg. /crons/pipe.php. These changes will need to be re-applied after the upgrade is complete.</div>
  
 
== Troubleshooting ==
 
== Troubleshooting ==
 +
 
The actions performed by the Automatic Updater are recorded in the tblupdatelog table within the WHMCS database. To troubleshoot upgrade problems it is useful to review this table for the most recent entries (the highest id values). A tool such as phpmyadmin can be used to browse to the table contents.
 
The actions performed by the Automatic Updater are recorded in the tblupdatelog table within the WHMCS database. To troubleshoot upgrade problems it is useful to review this table for the most recent entries (the highest id values). A tool such as phpmyadmin can be used to browse to the table contents.
 +
 +
For additional guides to troubleshooting auto-update problems, see [http://help.whmcs.com/m/updating Updating] and [[Upgrading New Installation Prompt]].
  
 
===Please ensure you have selected a valid Update Channel and then try again===
 
===Please ensure you have selected a valid Update Channel and then try again===
Receiving this error message in the cron job report email or activity log, indicates that an Update Channel setting needs selecting. To do this, navigate to ''Utilities > Update WHMCS'' and click '''Configure Update Settings'''.
+
 
 +
Receiving this error message in the cron job report email or activity log, indicates that an Update Channel setting needs selecting. To do this, click '''Configure Update Settings'''.
  
 
Next select one of the four available update channel options, and Click Save Changes. The options are [[#Choosing an Update Channel|described above]].
 
Next select one of the four available update channel options, and Click Save Changes. The options are [[#Choosing an Update Channel|described above]].
 
===Unable to connect to the WHMCS Update Server===
 
This error message may be encountered when attempting to perform an automatic update or appear in the Activity Log. It means that your server was unable to connect to our update server. From your server's command line, attempt the following two cURL connections:
 
 
<div class="source-cli">
 
curl https://releases.whmcs.com/packages.json
 
 
curl https://pki.whmcs.com/
 
</div>
 
 
The expected return is a '''StatusCode: 200'''. If any other results is returned please work with your server admin or hosting provider to investigate the connectivity problem between your server and the WHMCS update server.
 
  
 
===Permission Errors===
 
===Permission Errors===
Permission errors may manifest themselves in the tblupdatelog table as the following:
 
<div class="source-cli">
 
[WHMCS\Exception] Failed to perform early file copy during WHMCS file relocation: init.php
 
</div>
 
or
 
<div class="source-cli">
 
[RuntimeException] /path/to/whmcs/whmcs does not exist and could not be created.
 
</div>
 
  
These kinds of file permission and ownership issues are multi-faceted and dependant upon the individual server configuration. However for a standard '''cPanel''' server using the '''suPHP''' PHP Handler an appropriate posix file permissions permissions would be:
+
Permission errors in the update log may resemble the following examples:
  
<div class="docs-alert-warning">
+
* <tt>[WHMCS\Exception] Failed to perform early file copy during WHMCS file relocation: init.php</tt>
configuration.php - 400<br/>
+
* <tt>[RuntimeException] /path/to/whmcs/whmcs does not exist and could not be created.</tt>
/crons/pipe.php - 755<br/>
+
* <tt>failed to open stream: Permission denied</tt>
All other PHP files 644<br/>
+
* <tt>Apply update dry-run detected 1 permission issues</tt>
All directories 755<br/>
 
</div>
 
  
The file ownership and group should be the same as the user directory name. Eg. On a cPanel box where the web-root is located at ''/home/'''david'''/public_html/'', files should be owned by '''david''', and the group should be '''david'''.
+
The exact file permission and ownership issues will depend on the individual server configuration. However, for a standard cPanel & WHM server using the suPHP PHP handler, the following configuration would be an appropriate POSIX file permissions:
  
Finally, the owner and group of the PHP process seeking to take action should be the same as the user directory name. Eg. On a cPanel box where the web-root is located at ''/home/'''david'''/public_html/'',  PHP process owner and group should be '''david'''.
+
* <tt>configuration.php</tt> — <tt>400</tt>
 +
* <tt>/crons/pipe.php</tt> — <tt>755</tt>
 +
* All other PHP files — <tt>644</tt>
 +
* All directories — <tt>755</tt>
  
Other types of server and PHP handlers may have different configuration requirements, the above is intended as a guide for one particular possible combination only.
+
The file ownership and group should be the same as the user directory name. For example, on a cPanel & WHM server with a web root at <tt>/home/username/public_html/</tt>, the <tt>username</tt> user would own the files and the group would also use the name <tt>username</tt>.
  
===Curl 77 Error===
+
Finally, the owner and group of the PHP process must be the same as the user directory name. For example, on a cPanel & WHM server with a web root at <tt>/home/username/public_html/</tt>, the PHP process owner and group would both be <tt>username</tt>.
CURL77 errors may manifest as the following in the tblupdatelog table:
 
<div class="source-cli">
 
[WHMCS\Installer\Composer\ComposerUpdateException] Failed to get certificate metadata from keyserver. Error: Unable to download file from URL:  Message cURL error 77: Problem with the SSL CA cert (path? access rights?) update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] []...
 
</div>
 
This error indicates that the server was unable to connect to the WHMCS update server because the security of the connection could not be verified. The connection is secured using SSL certificates and to verify the certificate your server needs up-to-date root certificates to know which to trust.  
 
  
Please work with your server administrator or hosting provider to ensure the root CA bundles are fully updated on your server.
+
Other types of server and PHP handlers may have different configuration requirements.

Revision as of 11:41, 23 June 2022

This page describes a feature available in version 7.0 and above

The Automatic Update utility allows admin users to update WHMCS quickly and easily in just a few clicks.

You can access this feature at Utilities > Update WHMCS.

For more information on the way in which updates change files, see Updater File Changes.

System Requirements

For automatic updates to be possible, the following system requirements apply:

  • A PHP Memory limit of at least 128MB
  • At least 250 MB of free disk space
  • PHP setting allow_url_fopen enabled
  • PHP max_execution_time in excess of 60 seconds
  • PHP Zip Extension or the proc_open PHP function enabled
  • PHP setting open_basedir to include entire WHMCS docroot

Configuring Your Update Settings

Choosing an Update Channel

The WHMCS automatic updater allows you to choose an update channel that defines the type of updates you will receive. The update channel setting determines the least stable version you are willing to update to:

Channel Description
Stable Recommended for most installations of WHMCS, the Stable channel will only apply Stable updates to your installation.
Current Version Subscribing to this channel will restrict you to only receiving maintenance updates for the major/minor version that is currently installed. For example if you are on a version that is in Long Term Support and a patch is issued for that series, this channel allows you to apply the patch and remain on that series.
This is useful for applying minor updates and security releases. More details below.
Release Candidate Subscribing to the Release Candidate channel will allow you to receive releases after beta testing but before they are released to the Stable tier.
Beta Subscribing to the Beta release channel will allow you to receive the very latest versions of WHMCS. This tier should only be selected for development and test based installations.

Patch and Maintenance Release Updates

  • If you are on a version that is in Long Term Support and a patch is issued for that series, you can use the Updater to apply the patch and remain on that series.
  • To do this, select the Current Version update channel as described above.
  • You many need to click Check for Updates after any setting changes in order to refresh the available version displayed within the page.

You may wish to change this setting back to "Stable" after updating to ensure future checks display the latest Active Development version available to you.

Setting a Temporary Update Path

A temporary path is required for staging of files during an update. For security reasons it is recommended that this directory be located outside the public doc root, similar to the attachments, downloads and templates_c directories. The path must be an absolute path (i.e. /home/whmcsuser/tmp instead of ~/tmp) and must be writable by the user that is running PHP.

Setting a Maintenance Message

This option can be used to set a message that will be displayed to both other admin and client users whenever an update is in progress.

Modifying the update configuration requires the Modify Update Configuration administrator role permission, which is separate from the "Update WHMCS" permission.
Configureupdatesettings.png

Checking for Updates

New updates are checked for periodically automatically.

When an update becomes available, a notification will appear in the top left corner of admin area as shown below.

Screenshot 2017-06-01 10.32.27.png

Manually checking for updates

You can check for updates on-demand by clicking the Check for Updates button.

If a release has just been published you may need to do this to see the update as available prior to the next automated check.

For Owned licenses, the version fetched by the utility will be the version of WHMCS that was available when your Support and Updates Subscription was active. Downloading the latest version of WHMCS requires an active Support and Updates Subscription.

UpdateAvailable.png

Performing an Update

To perform an update:

  1. Make certain that your server meets the system requirements and review the Release Notes for any important notices and information.
  2. Make a full backup of your current installation.
  3. In WHMCS, click Update Now.
    This option only displays if an update is available for your current update channel.
  4. Follow the prompts to complete the update process. The update process can take anywhere from 30 seconds to a few minutes to complete.

If you have custom template files you will also need to review and make any necessary changes to your custom templates using the information provided in the Template Changes section of the Release Notes.

Your customisations will be preserved during the update if you are leveraging the recommended methods for customising things such as templates, WHOIS servers, Additional Domain Fields and Countries
If you have customised the permissions on any of the files eg. /crons/pipe.php. These changes will need to be re-applied after the upgrade is complete.

Troubleshooting

The actions performed by the Automatic Updater are recorded in the tblupdatelog table within the WHMCS database. To troubleshoot upgrade problems it is useful to review this table for the most recent entries (the highest id values). A tool such as phpmyadmin can be used to browse to the table contents.

For additional guides to troubleshooting auto-update problems, see Updating and Upgrading New Installation Prompt.

Please ensure you have selected a valid Update Channel and then try again

Receiving this error message in the cron job report email or activity log, indicates that an Update Channel setting needs selecting. To do this, click Configure Update Settings.

Next select one of the four available update channel options, and Click Save Changes. The options are described above.

Permission Errors

Permission errors in the update log may resemble the following examples:

  • [WHMCS\Exception] Failed to perform early file copy during WHMCS file relocation: init.php
  • [RuntimeException] /path/to/whmcs/whmcs does not exist and could not be created.
  • failed to open stream: Permission denied
  • Apply update dry-run detected 1 permission issues

The exact file permission and ownership issues will depend on the individual server configuration. However, for a standard cPanel & WHM server using the suPHP PHP handler, the following configuration would be an appropriate POSIX file permissions:

  • configuration.php400
  • /crons/pipe.php755
  • All other PHP files — 644
  • All directories — 755

The file ownership and group should be the same as the user directory name. For example, on a cPanel & WHM server with a web root at /home/username/public_html/, the username user would own the files and the group would also use the name username.

Finally, the owner and group of the PHP process must be the same as the user directory name. For example, on a cPanel & WHM server with a web root at /home/username/public_html/, the PHP process owner and group would both be username.

Other types of server and PHP handlers may have different configuration requirements.