Upgrading
This guide explains how to upgrade Live Helper Chat (LHC) from version 2.04 onwards. LHC can automatically update the database from any previous version. Since version 3.30, installing from source requires Composer dependencies.
Prerequisites
- Composer: Required for source installations (version 3.30+). If you don't have it, download
composer.phar
from https://getcomposer.org/download/. - PHP 8.2 (Recommended): For the latest version with dependencies, download the
*.v-with-dependencies.tgz
file from https://github.com/LiveHelperChat/livehelperchat/releases. This includes thelib/vendor
folder, so you don't need to install Composer separately. Extract the contents tolib/vendor
.
Upgrade Steps
- Check Announcement: Review the announcement for the new version to identify any required changes in
settings/settings.ini.php
. - Update Database:
- Go to "System" -> "Update information" to check for database differences. If any are found, click "Update database."
- If the web interface is inaccessible, run the following commands from the root folder:
php cron.php -s site_admin -c cron/util/update_database
(Updates from the remote URL.)- If the above command fails, use:
php cron.php -s site_admin -c cron/util/update_database -p local
(Run after replacing files).
- Manual Database Update (If Files Were Overwritten):
- Update the database from the local definition.
- Alternatively, copy
doc/shell/upgrade.php
to the root folder and access it through your browser (e.g.,https://example.com/upgrade.php
).
- Logout: Log out of LHC.
- Replace Files:
- Download the latest LHC version.
- Overwrite the following folders:
doc
,ezcomponents
,lib
,modules
,pos
,translations
, anddesign
. - Also, overwrite
index.php
andcron.php
. - Downloads:
- https://github.com/remdex/livehelperchat/archive/master.zip (Latest master branch without Composer dependencies.)
- https://github.com/LiveHelperChat/livehelperchat/releases (Latest release with Composer dependencies.)
- Update Composer Dependencies (If Applicable):
- Overwrite
composer.json
andcomposer.lock
. - Run
composer install
orcomposer update
.
- Overwrite
- Disable Cache: Disable the cache in
settings.ini.php
(refer to debug.md#disabling-cache). - Clear Cache:
- Log back in and go to "System configuration" -> "Clear Cache," then click "Clear Cache."
- Alternatively, run
php cron.php -s site_admin -c cron/util/clear_cache
from the command line.
- Re-enable Cache: Re-enable the cache in
settings.ini.php
. - Troubleshooting: If errors persist, enable debug output.
Upgrading from Older Versions
For older versions, follow these steps:
- Replace Files: As described in step 4 above.
- Install Composer Dependencies: As described in step 5 above, or download the
*.v-with-dependencies.tgz
file and copylhc_web/lib/vendor
to your installation. - Run Upgrade Script: Copy
doc/shell/upgrade.php
to the LHC root folder. - Access Script: Open
chatfolder/upgrade.php
in your browser to update the database and clear the cache. - Delete Script: Remove
upgrade.php
from the root folder.
Important Considerations
- Backup: Always create a backup before upgrading.
- Further Reading:
PHP 8.1 Compatibility (Losing Facebook Messenger)
Edit
composer.json
:- Change
"php": ">=8.2"
to"php": ">=8.1"
. - Remove the following lines:
"tgallice/fb-messenger-sdk": "dev-master#47498e9926df01f2633835ff3ffb310f88ac444f",
"symfony/event-dispatcher": "^7.1",- Change
Update Composer: Run
composer update
.
Permissions
The operator requires the 'lhsystem', 'performupdate'
permission to view "Update information."
Troubleshooting
If you encounter any issues:
- Verify Files: Ensure all files have been uploaded correctly.
- Check Logs: Review server error logs for specific messages.
- PHP Version: Confirm that your PHP version meets the requirements.
- Revert: Restore from your backup if the upgrade fails.
- Seek Help: Consult community forums or support channels.