<commit_before>Upgrading
=========

Upgrade procedure
-----------------

We recommend you take a full backup of the database and files before upgrading.

If you have any message ques running, :doc:`make sure you read the notes there about upgrading<installMessageQue>`.

Place the new files over the old ones. (If you have had to change any 
"localConfig.php" files to accomodate your webserver, be careful to preserve 
the changes.

Run the PHP script "php core/cli/upgradeDatabase.php".

Run the PHP script "php core/cli/loadStaticData.php".

On servers not in Debug mode, delete the existing cached templates. These are 
found in "cache/templates.cli" and "cache/templates.web". (It doesn't hurt to 
do this on debug servers so if in doubt, just do it.)

If you have changed theme variables, you should :doc:`run the web asset compilation procedure again<webAssets>`.

Assets Version and Browser Caching
----------------------------------

There are Apache config files included in the software that turn on browser caching 
for assets, such as images, CSS and JS. This should help speed up subsequent page loads for users. 

However when you update, you must make sure users get the latest version of all assets. Do this using the config variable.

    $CONFIG->assetsVersion = 1

This is appended to the end of all requests. Set this to 1 on a new install and increase the value by 1 
every time you upgrade.<commit_msg>Add markup for code sample<commit_after>Upgrading
=========

Upgrade procedure
-----------------

We recommend you take a full backup of the database and files before upgrading.

If you have any message ques running, :doc:`make sure you read the notes there about upgrading<installMessageQue>`.

Place the new files over the old ones. (If you have had to change any 
"localConfig.php" files to accomodate your webserver, be careful to preserve 
the changes.

Run the PHP script "php core/cli/upgradeDatabase.php".

Run the PHP script "php core/cli/loadStaticData.php".

On servers not in Debug mode, delete the existing cached templates. These are 
found in "cache/templates.cli" and "cache/templates.web". (It doesn't hurt to 
do this on debug servers so if in doubt, just do it.)

If you have changed theme variables, you should :doc:`run the web asset compilation procedure again<webAssets>`.

Assets Version and Browser Caching
----------------------------------

There are Apache config files included in the software that turn on browser caching 
for assets, such as images, CSS and JS. This should help speed up subsequent page loads for users. 

However when you update, you must make sure users get the latest version of all assets. Do this using the config variable.

.. code-block:: php

    $CONFIG->assetsVersion = 1

This is appended to the end of all requests. Set this to 1 on a new install and increase the value by 1 
every time you upgrade.
{'fraction_non_alphanumeric': 0.090499306518724, 'fraction_numerical': 0.0020804438280166435, 'mean_word_length': 3.4937694704049846, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3251959', 'n_tokens_mistral': 746, 'n_tokens_neox': 713, 'n_words': 423}