How to delete ticket attachments and reduce database size

Note: This article is only useful for self-hosted installations of LiveAgent, as it requires database access. When you need to reduce the size of database (e.g. you're running out of disk space) the first thing you should consider is use our Amazon S3 File Archive plugin (https://support.liveagent.com/214341-Amazon-S3-File-Archive-plugin). If you don't want to or for some reason can't use Amazon S3 File Archive plugin, the second option you can do is remove some of the old and no longer needed...

How to set up cron job for LiveAgent on a Windows server?

LiveAgent has files jobs.php and queue.php that need to be executed periodically. On Linux servers this is solved by cron. Windows server offers tool called "Task Scheduler" that provides the ability to schedule the launch of programs or scripts at pre-defined times or after specified time intervals. You need to create a Task Scheuler entry which will execute the following command: "C:\<Path_to_PHP_executable>\php.exe" -f "C:\<Path_to_LiveAgent_installation>\scripts\jobs.php"...

Error parsing json, unexpected character

This article will be useful for administrators of LiveAgent installed on their own servers. If you encounter the following error Error parsing JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data it means that instead of JSON response from LiveAgent API, the client application in browser received something that is not JSON. In most cases, it is because the request to API e.g. /api/v3/contacts/ is handled by incorrect index.php file. If you have mod_rewrite ...

How to change the database password

The access credentials as well as database server host name and port are stored in a file in <LiveAgent_installation_folder>/accounts/settings.php When you need to change the password for access to database, copy the original value of DB_PASSWORD and set it to a new setting named ENCRYPTION_KEY. Since version 5.16.32.2 the database password is used also for encryption of passwords and keys stored in the database. If found in the settings.php file, the ENCRYPTION_KEY is used to encrypt an...

How to set a timezone in downloadable licenses

From version 5.13 the setting of time zone has been moved to database table qu_g_settings. In downloadable licenses, you can define your own timezone as the default timezone matches Los Angeles (USA) time. To do so, edit your accounts/settings.php file and add this line of code there: TIMEZONE=America/Los_Angeles insert a row into table qu_g_settings with name="TIMEZONE" and value of a valid timezone name. Changing timezone of an existing LiveAgent installation is discouraged. The setting affe...

How to backup LiveAgent database

To keep your data safe, we recommend at least daily backup of your database. It could be hard task to backup complete database if you have hundreds thousands tickets in your database and DB size is hundreds of Gigabytes big. Here are some recommendations how we do it to make backups less painful: 1. If you can afford more DB servers, setup DB servers as MASTER-SLAVE and make backups always on the SLAVE server to avoid DB locks. In case this is not an option for you to keep 2 servers, you shoul...

Queue cron job

From version 5.11 of LiveAgent it is required to set up 2 cron jobs instead of just 1. All you need to do is just add another entry to crontab or in your cPanel settings with file name queue.php instead of jobs.php. The original jobs.php crontab entry should remain unchanged. The crontab lines are: */1 * * * * /usr/bin/php -q /var/www/liveagent/scripts/jobs.php */1 * * * * /usr/bin/php -q /var/www/liveagent/scripts/queue.php /usr/bin/php should be the path to your php binary and depends on ...

Some searches are slow even though elasticsearch is configured

By default, elasticsearch is used only for fulltext search (when searching for some specific text) and for some computationally intensive filters (exclude tag, the message added by the user, the message added on date and time). If you want to enable the use of elasticsearch for all searches, you can do it by adding setting name='force_es' and value='Y' to table qu_g_settings. The risk of using elasticsearch for all searches is that if the data in elasticsearch index is not up to date with the ...

Force https / SSL

If you wish to open all the requests to LiveAgent always with https protocol then try adding the following lines into your .htaccess files in the LiveAgent root folder and in its /agent folder: RewriteCond %{HTTP:X-Forwarded-Proto} !=https RewriteRule (.*) https://%{SERVER_NAME}/$1 [redirect=permanent,last] Add those lines right under the line with: RewriteEngine on

Errors caused by UTF8 emoji characters

If LiveAgent is causing errors when you receive a Facebook message or email containing UTF8 emoji (emoticon, smiley) characters, it is caused by the database "collation" or "character set". MySQL "utf8" only supported characters 3-bytes long. Emoji characters belong to the group of characters that occupy 4 bytes. To overcome this limitation MySQL introduced a fixed character set called "utf8mb4" in version MySQL 5.5. If you install LiveAgent on database MySQL 5.5 or higher, the columns are alr...