Difference between revisions of "Automatic Updater"

From WHMCS Documentation

(Choosing an Upgrade Channel)
(Manually checking for updates)
 
(66 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
<div class="docs-alert-info">
 +
<i class="fa fa-question-circle"></i> We added this feature in WHMCS 7.0.
 +
</div>
  
== Requirements ==
+
The Automatic Update utility allows admins to update WHMCS quickly and easily from directly within the Admin Area.
  
*The Automatic Updater requires at least 250 MB of free disk space
+
You can access this feature at '''Utilities > Update WHMCS'''.
*The Automatic Updater requires PHP setting allow_url_fopen = true
 
*The Automatic Updater requires PHP setting open_basedir to include entire WHMCS docroot
 
*The Automatic Updater can take a few minutes, so you'll need to ensure that you allow long running php processes in your webserver
 
  
 +
For more information on the way in which updates change files, see [[Updater File Changes]].
  
== Checking for Updates ==
+
== System Requirements ==
 
 
Introduced in WHMCS 7.0.0, the Automatic Updater provides admins with a quick and easy way to update to new versions of WHMCS with just a few clicks in the admin area interface. The system will check for new updates on each cron run. Upon logging into the WHMCS admin area, a notification will appear in the top right corner of admin area. This alert will let the admin know if a new version of WHMCS is available, or if the version of WHMCS that is currently installed is the latest version. Below are examples of what these notifications look like:
 
 
 
[[File:UpdateNotification.png|center]]
 
  
Admins can also manually check for updates by navigating to the Utilities top menu in the admin area interface and select Update WHMCS.
+
WHMCS has several system requirements for automatic updates:
  
 
+
* A PHP memory limit of at least 128MB.
[[File:WHMCSUpdateMenu.png|center]]
+
* At least 250 MB of free disk space.
 
+
* The PHP <tt>allow_url_fopen</tt> setting is enabled.
 
+
* The PHP <tt>max_execution_time</tt> setting is 60 seconds or more.
Once selected, the admin will be asked to confirm their password, as only admin users that have the "Update WHMCS" admin role will be able to access the updater.
+
* The PHP Zip Extension or the <tt>proc_open</tt> PHP function are enabled.
 
+
* The PHP <tt>open_basedir</tt> setting includes the entire WHMCS document root.
 
 
[[File:UpdateConfirmPassword.png|center]]
 
 
 
 
Once in the Automatic Update interface, admins can tell at a glance what version of WHMCS that is installed, as well as check for updates using the Check for Updates button.
 
 
 
 
 
[[File:NoNewUpdatesAreAvailable.png|center]]
 
 
 
[[File:UpdateAvailableNotice.png|center]]
 
 
 
 
 
By clicking Check for Updates, the version indicated in Your Version on the left side of the version summary will stay the same, but the information presented in the Latest Version on the right side of the version summary may be updated depending if a new update is available. It should also be noted that the Check Now button also indicates the last time an update check was performed. If a new version is available for upgrade, admins can then begin the update process by clicking the Update Now button.
 
 
 
[[File:UpdateAvailableBody.png|center]]
 
  
 
== Configuring Your Update Settings ==
 
== Configuring Your Update Settings ==
  
The Automatic Updater also presents admins with the ability to configure update settings such as choosing an update channel, setting a temporary update path, and setting an update maintenance message for customers. Note that accessing the update configuration page requires "Modify Update Configuration" administrator role, which is separate from "Update WHMCS" role.
+
=== Update Channel ===
 
 
=== Choosing an Upgrade Channel ===
 
  
The automatic updater provides admins with the ability to set the release stability that they are comfortable receiving. Admins will be able to select from the following channels:
+
The Automatic Updater allows you to choose the update channel for the least stable version you are willing to update to:
  
 
<table class="table table-striped">
 
<table class="table table-striped">
Line 53: Line 33:
 
<tr>
 
<tr>
 
<td>Stable</td>
 
<td>Stable</td>
<td>Recommended for most installations of WHMCS, the Stable channel will present admins with the latest stable version that has been released by WHMCS.</td>
+
<td>'''Recommended'''<br/>Only receive Stable updates to your installation.</td>
 +
</tr>
 +
<tr>
 +
<td>Current Version</td>
 +
<td>Only receive maintenance updates for the currently-installed major and minor version. For example, if you are on a version in [[Long Term Support]] and we release a patch for it, this channel applies the patch but will not upgrade you to a later WHMCS version.<div class="docs-alert-info">This is useful for applying minor updates and security releases (see below).</div></td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>Release Candidate</td>
 
<td>Release Candidate</td>
<td>Admins subscribed to the Release Candidate will be able to upgrade to the latest Release Candidate builds of WHMCS, or the latest stable version of WHMCS - whichever is newer. This means if WHMCS is upgraded to 7.0.0-rc.1, when 7.0.0-GA is released, the admin will be prompted to upgrade to the general availability that was just released.</td>
+
<td>Receive releases after beta testing but before we release them to the Stable tier.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>Beta</td>
 
<td>Beta</td>
<td>Admins subscribed to the Beta release channel will be able to download the newest beta, release candidates, and stable versions of WHMCS. This is for testing installations, as it will allow admins to update to the latest WHMCS (beta, rc, or stable). WHMCS recommends development licenses use this channel.</td>
+
<td>Receive the latest versions of WHMCS as we release them to the Beta tier. Only select this tier for development and testing installations.</td>
</tr>
 
<tr>
 
<td>Current Version</td>
 
<td>By selecting this channel, admins are electing to only receive maintenance updates for the major/minor version they are on. For example if the installed version of WHMCS is running 7.0.0-GA, admins will be offered 7.0.1-GA, but not 7.1.0. This channel is useful if the installed version of WHMCS has a number of 3rd party modules and customizations that need to be tested before upgrading to a new production release.</td>
 
 
</tr>
 
</tr>
 
</table>
 
</table>
  
=== Setting a Temporary Update Path ===
+
==== Patch and Maintenance Release Updates ====
 +
 
 +
If you are on a WHMCS version that is in [[Long Term Support]] and we issue a patch for that version, you can use the Automatic Updater to apply the patch without moving to a newer WHMCS version.
 +
 
 +
To do this:
 +
 
 +
# Select the '''Current Version''' update channel (see above).
 +
# Click '''Check for Updates''' to refresh the available version.
 +
# Proceed with your update as usual.
 +
 
 +
<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>
 +
 
 +
=== Temporary Update Path ===
 +
 
 +
The temporary path allows you to stage files during an update. For security reasons, ensure that this directory is outside of the public document root, like the <tt>attachments</tt>, <tt>downloads</tt>, and <tt>templates_c</tt> directories.
  
The temporary path is used for staging files during an update. For security reasons it is recommended that this directory be located outside the public doc root, just like the attachments, templates_c, and downloads directories. The path must be an absolute path (i.e. /home/whmcsuser/tmp instead of ~/tmp) and must be writable by the admin that is running PHP.  
+
* The path must be an absolute path (for example, <tt>/home/username/tmp</tt> instead of <tt>~/tmp</tt>).
 +
* The path must be writable by the user that is running PHP.
  
=== Setting a Maintenance Message ===
+
=== Maintenance Message ===
  
Admins can use this option to set a message that will be displayed to users in the client area whenever an update is in progress, as the client and admin areas will be unavailable during an update.  
+
Use this option to set a message to display to other admins and users whenever an update is in progress.
  
[[File:EmptyConfigureUpdateSettings.png|center]]
+
<div class="docs-alert-info">
 +
Modifying the update configuration requires the '''Modify Update Configuration''' [[Administrator Roles|administrator role permission]], which is separate from the '''Update WHMCS''' permission.
 +
</div>
 +
 
 +
== Checking for Updates ==
 +
 
 +
The system automatically checks for updates periodically. When an update becomes available, a notification will appear in the Admin Area.
 +
 
 +
===Manually checking for updates===
 +
 
 +
You can check for updates on demand by clicking '''Check for Updates'''. You may need to do this to see recent releases prior to the next automated check.
 +
 
 +
<div class="docs-alert-info">
 +
For Owned licenses, the version that this fetches 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.
 +
</div>
 +
 
 +
For a step-by-step tutorial, see [https://help.whmcs.com/m/updating/l/678174-checking-for-updates-manually Checking for Updates Manually].
  
 
== Performing an Update ==
 
== Performing an Update ==
  
=== Beginning the Update Process ===
+
<div class="docs-alert-info">
 +
We recommend using the '''Automatic Updater''' utility every time you update WHMCS. However, you can also perform an update [https://go.whmcs.com/1709/Updating-WHMCS-Manually manually through the browser] or [[Install On The Command Line|on the command line]].
 +
</div>
 +
 
 +
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-warning"><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.
 +
# Perform the necessary steps for your customizations:
 +
#* If you use any custom file permissions, you '''must''' update the relevant files (for example, for <tt>/crons/pipe.php</tt>).
 +
#* If you have custom template files, review and update your custom templates using the '''Template Changes''' section of the [[Release Notes|release notes]].
 +
 
 +
<div class="docs-alert-success">
 +
The update will not alter your customizations if you follow our official customization guidelines (for example, our guidelines for [https://developers.whmcs.com/themes/ templates], [[WHOIS_Servers|Whois servers]], [[Additional Domain Fields|additional domain fields]], and [[Customising Countries and Calling Codes|country and calling codes]].
 +
</div>
 +
 
 +
== Troubleshooting ==
 +
 
 +
You can find the log of Automatic Updater actions in the <tt>tblupdatelog</tt> table in the WHMCS database. To troubleshoot upgrade problems, review this table for the most recent entries (the highest <tt>id</tt> values). You can use a tool like phpMyAdmin to browse the table's contents.
 +
 
 +
For more information on troubleshooting update issues, see [[Upgrading New Installation Prompt]] and [http://help.whmcs.com/m/updating our update troubleshooting guides].
 +
 
 +
===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 you need to select an update channel.
 +
 
 +
To fix this issue:
 +
 
 +
# Click '''Configure Update Settings'''. 
 +
# Select one of the four available update channel options ([[#Choosing an Update Channel|see above]]).
 +
# Click '''Save Changes'''.
 +
 
 +
===Permission Errors===
 +
 
 +
Permission errors in the update log may resemble the following examples:
 +
 
 +
* <tt>[WHMCS\Exception] Failed to perform early file copy during WHMCS file relocation: init.php</tt>
 +
* <tt>[RuntimeException] /path/to/whmcs/whmcs does not exist and could not be created.</tt>
 +
* <tt>failed to open stream: Permission denied</tt>
 +
* <tt>Apply update dry-run detected 1 permission issues</tt>
 +
 
 +
The exact file permission and ownership issues 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:
 +
 
 +
* <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>
  
Once the update configuration options have been set, admins can begin the update process. Before the update process begins, WHMCS strongly recommends that admins backup their current installation and database. WHMCS also recommends that at least 250 MB of disk space is available before beginning the update process. Once comfortable with the available disk space and backups have been made to the current installation and database, the admin can start the update by clicking the Continue button.
+
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>, <tt>username</tt> would own the files and the group would also use the name <tt>username</tt>.
  
[[File:UpdateNowFirstStep.png|center]]
+
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>.
  
 +
Other types of server and PHP handlers may have different configuration requirements.
  
=== Checking for Custom Files ===
+
===Unable to connect to the WHMCS Update Server===
The next step in the upgrade process checks the current installation for customized files, such as template files, language translations, whois server entries, and additional domain fields. It's important to review these files, as just like in previous updates, any update applied to the installation of WHMCS will override any custom changes. Before continuing to the next step in the upgrade process, it is wise to backup any customized files in order to quickly apply them again after the update has been complete. WHMCS has also included changes to how admins can customize the additional domain fields, country / calling codes, and whois server entries so that admins can preserve changes between updates. To view this documentation, please refer to following documentation pages:
 
  
*[http://docs.whmcs.com/Customising_Countries_and_Calling_Codes/ Customized Countries and Calling Codes]
+
This error indicates that your server could not connect to the WHMCS update server.
*[http://docs.whmcs.com/WHOIS_Servers/ WHOIS Servers]
 
*[http://docs.whmcs.com/Additional_Domain_Fields/ Additional Domain Fields]
 
 
[[File:UpdateNowSecondStep.png|center]]
 
  
=== Starting the Update ===
+
You may see it in two locations:
  
Once an admin is comfortable with the status of their custom files, the next step in the update process is to start the update itself. It's important to note that this third step is the point of no return - one the update has started, there is no pausing or stopping the process, and it is strongly recommended that admins stay on this page and do not navigate away using their browser. When ready to begin, click the Update Now button.  
+
* While attempting an automatic update.
 +
* In the '''Activity Log''' section at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > [[System Logs]]''' or, prior to WHMCS 8.0, '''Utilities > Activity Log'''.
  
[[File:UpdateNowThirdStep.png|center]]
+
To resolve this, attempt the following cURL connections from your server's command line:
  
=== Finalizing the Update ===
+
<div class="source-cli">
 +
<nowiki>curl -v https://releases.whmcs.com/v2/packages.json</nowiki>
  
The final step of the update process is confirmation that the update has been completed. The system will present the admin with an Update Completed message, along with a link to the current version's release notes.
+
<nowiki>curl -v https://pki.whmcs.com/
 +
</nowiki></div>
  
[[File:UpdateFinished.png|center]]
+
If these commands succeed, they will return <tt>StatusCode: 200</tt>. If they do not, ask your hosting provider or system administrator to investigate the connectivity problem between your server and the WHMCS update server.

Latest revision as of 18:21, 31 January 2023

We added this feature in WHMCS 7.0.

The Automatic Update utility allows admins to update WHMCS quickly and easily from directly within the Admin Area.

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

WHMCS has several system requirements for automatic updates:

  • A PHP memory limit of at least 128MB.
  • At least 250 MB of free disk space.
  • The PHP allow_url_fopen setting is enabled.
  • The PHP max_execution_time setting is 60 seconds or more.
  • The PHP Zip Extension or the proc_open PHP function are enabled.
  • The PHP open_basedir setting includes the entire WHMCS document root.

Configuring Your Update Settings

Update Channel

The Automatic Updater allows you to choose the update channel for the least stable version you are willing to update to:

Channel Description
Stable Recommended
Only receive Stable updates to your installation.
Current Version Only receive maintenance updates for the currently-installed major and minor version. For example, if you are on a version in Long Term Support and we release a patch for it, this channel applies the patch but will not upgrade you to a later WHMCS version.
This is useful for applying minor updates and security releases (see below).
Release Candidate Receive releases after beta testing but before we release them to the Stable tier.
Beta Receive the latest versions of WHMCS as we release them to the Beta tier. Only select this tier for development and testing installations.

Patch and Maintenance Release Updates

If you are on a WHMCS version that is in Long Term Support and we issue a patch for that version, you can use the Automatic Updater to apply the patch without moving to a newer WHMCS version.

To do this:

  1. Select the Current Version update channel (see above).
  2. Click Check for Updates to refresh the available version.
  3. Proceed with your update as usual.

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.

Temporary Update Path

The temporary path allows you to stage files during an update. For security reasons, ensure that this directory is outside of the public document root, like the attachments, downloads, and templates_c directories.

  • The path must be an absolute path (for example, /home/username/tmp instead of ~/tmp).
  • The path must be writable by the user that is running PHP.

Maintenance Message

Use this option to set a message to display to other admins and 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.

Checking for Updates

The system automatically checks for updates periodically. When an update becomes available, a notification will appear in the Admin Area.

Manually checking for updates

You can check for updates on demand by clicking Check for Updates. You may need to do this to see recent releases prior to the next automated check.

For Owned licenses, the version that this fetches 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.

For a step-by-step tutorial, see Checking for Updates Manually.

Performing an Update

We recommend using the Automatic Updater utility every time you update WHMCS. However, you can also perform an update manually through the browser or on the command line.

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.
  5. Perform the necessary steps for your customizations:
    • If you use any custom file permissions, you must update the relevant files (for example, for /crons/pipe.php).
    • If you have custom template files, review and update your custom templates using the Template Changes section of the release notes.

The update will not alter your customizations if you follow our official customization guidelines (for example, our guidelines for templates, Whois servers, additional domain fields, and country and calling codes.

Troubleshooting

You can find the log of Automatic Updater actions in the tblupdatelog table in the WHMCS database. To troubleshoot upgrade problems, review this table for the most recent entries (the highest id values). You can use a tool like phpMyAdmin to browse the table's contents.

For more information on troubleshooting update issues, see Upgrading New Installation Prompt and our update troubleshooting guides.

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 you need to select an update channel.

To fix this issue:

  1. Click Configure Update Settings.
  2. Select one of the four available update channel options (see above).
  3. Click Save Changes.

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 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/, username 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.

Unable to connect to the WHMCS Update Server

This error indicates that your server could not connect to the WHMCS update server.

You may see it in two locations:

  • While attempting an automatic update.
  • In the Activity Log section at Configuration () > System Logs or, prior to WHMCS 8.0, Utilities > Activity Log.

To resolve this, attempt the following cURL connections from your server's command line:

curl -v https://releases.whmcs.com/v2/packages.json

curl -v https://pki.whmcs.com/

If these commands succeed, they will return StatusCode: 200. If they do not, ask your hosting provider or system administrator to investigate the connectivity problem between your server and the WHMCS update server.