<commit_before>Updating Zammad
***************

.. note:: Please backup your Zammad instance before update! You can learn how to back up Zammad on :doc:`/appendix/backup-and-restore`.

Source update
=============

1. Download Zammad to your system
---------------------------------

You can directly download Zammad from https://ftp.zammad.com/ or use the direct URL to get the latest stable release via https://ftp.zammad.com/zammad-latest.tar.gz

.. code-block:: sh

   $ cd /opt
   $ sudo wget https://ftp.zammad.com/zammad-latest.tar.gz
   $ sudo tar -C zammad -xzf zammad-latest.tar.gz
   $ sudo chown -R zammad /opt/zammad
   $ sudo su - zammad

2. Install all dependencies
---------------------------

.. code-block:: sh

   zammad@host $ cd zammad
   zammad@host $ gem install bundler

* For PostgreSQL (note, the option says "without ... mysql"):

.. code-block:: sh

   zammad@host $ bundle install --without test development mysql

* For MySQL (note, the option says "without ... postgres"):

.. code-block:: sh

   zammad@host $ bundle install --without test development postgres


3. Stop Zammad services
-----------------------

Stop the application server, websocket server and scheduler.

4. Upgrade your database
------------------------

.. code-block:: sh

   zammad@host $ export RAILS_ENV=production
   zammad@host $ export RAILS_SERVE_STATIC_FILES=true # only if you use no HTTP reverse proxy
   zammad@host $ rake db:migrate
   zammad@host $ rake assets:precompile

5. Start Zammad services
------------------------

Start the application server, websocket server and scheduler.

6. Go and login to Zammad
-------------------------


Update with RPM
===============


1. Stop Zammad
----------------

.. code-block:: sh

   $ sudo systemctl stop zammad


3. Update Zammad
----------------

.. code-block:: sh

   $ sudo yum update zammad

**Note: The package will automatically execute maintenance tasks like database changes and will restart Zammad for you.**


4. Start Zammad
----------------

.. code-block:: sh

   $ sudo systemctl start zammad


5. Go and log in to Zammad
--------------------------



Update with DEB
===============


**Note: Please backup your Zammad instance before update!**


1. Stop Zammad
----------------

.. code-block:: sh

   $ sudo systemctl stop zammad


3. Update Zammad
----------------

.. code-block:: sh

   $ apt-get update
   $ apt-get upgrade

**Note: The package will automatically execute maintenance tasks like database changes and will restart Zammad for you.**

4. Start Zammad
----------------

.. code-block:: sh

  $ sudo systemctl start zammad


5. Go and log in to Zammad
--------------------------

Updating elasticsearch
======================

If you want to upgrade your elasticsearch installation, please take a look at the `elasticsearch documentation <https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html>`_
as it will have the most current information for you.<commit_msg>Adding searchindex-remark for updating elasticsearch (#96)<commit_after>Updating Zammad
***************

.. note:: Please backup your Zammad instance before update! You can learn how to back up Zammad on :doc:`/appendix/backup-and-restore`.

Source update
=============

1. Download Zammad to your system
---------------------------------

You can directly download Zammad from https://ftp.zammad.com/ or use the direct URL to get the latest stable release via https://ftp.zammad.com/zammad-latest.tar.gz

.. code-block:: sh

   $ cd /opt
   $ sudo wget https://ftp.zammad.com/zammad-latest.tar.gz
   $ sudo tar -C zammad -xzf zammad-latest.tar.gz
   $ sudo chown -R zammad /opt/zammad
   $ sudo su - zammad

2. Install all dependencies
---------------------------

.. code-block:: sh

   zammad@host $ cd zammad
   zammad@host $ gem install bundler

* For PostgreSQL (note, the option says "without ... mysql"):

.. code-block:: sh

   zammad@host $ bundle install --without test development mysql

* For MySQL (note, the option says "without ... postgres"):

.. code-block:: sh

   zammad@host $ bundle install --without test development postgres


3. Stop Zammad services
-----------------------

Stop the application server, websocket server and scheduler.

4. Upgrade your database
------------------------

.. code-block:: sh

   zammad@host $ export RAILS_ENV=production
   zammad@host $ export RAILS_SERVE_STATIC_FILES=true # only if you use no HTTP reverse proxy
   zammad@host $ rake db:migrate
   zammad@host $ rake assets:precompile

5. Start Zammad services
------------------------

Start the application server, websocket server and scheduler.

6. Go and login to Zammad
-------------------------


Update with RPM
===============


1. Stop Zammad
----------------

.. code-block:: sh

   $ sudo systemctl stop zammad


3. Update Zammad
----------------

.. code-block:: sh

   $ sudo yum update zammad

**Note: The package will automatically execute maintenance tasks like database changes and will restart Zammad for you.**


4. Start Zammad
----------------

.. code-block:: sh

   $ sudo systemctl start zammad


5. Go and log in to Zammad
--------------------------



Update with DEB
===============


**Note: Please backup your Zammad instance before update!**


1. Stop Zammad
----------------

.. code-block:: sh

   $ sudo systemctl stop zammad


3. Update Zammad
----------------

.. code-block:: sh

   $ apt-get update
   $ apt-get upgrade

**Note: The package will automatically execute maintenance tasks like database changes and will restart Zammad for you.**

4. Start Zammad
----------------

.. code-block:: sh

  $ sudo systemctl start zammad


5. Go and log in to Zammad
--------------------------

Updating elasticsearch
======================

If you want to upgrade your elasticsearch installation, please take a look at the `elasticsearch documentation <https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html>`_
as it will have the most current information for you.

If, for whatever reason, you need to rebuild your search index after upgrading, use::

   $ zammad run rake searchindex:rebuild
   
.. warning:: This step may fail if Zammad is under heavy load:
   Elasticsearch locks the indices from deletion if you're pumping in new data, like receiving a new ticket.
   (This only applies to single-node deployments, not clusters.)
   
   If it does, try killing Zammad first::
   
      $ systemctl stop zammad
      $ zammad run rake searchindex:rebuild
      $ systemctl start zammad
{'fraction_non_alphanumeric': 0.18927589367552705, 'fraction_numerical': 0.00458295142071494, 'mean_word_length': 2.3471370143149284, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1731742', 'n_tokens_mistral': 1932, 'n_tokens_neox': 1743, 'n_words': 709}