Updating Zammad¶
Before updating Zammad, we strongly recommend to take a look at our release notes. You can find information about features and fixes as well as technical remarks and breaking changes.
Be aware that you should not skip major Zammad versions while updating.
That means, for example, your upgrade path from version 2.4 to 5.1 (assuming
this is the current stable) would be:
2.4
→ 3.0
→ 4.0
→ 5.0
→ latest stable (5.1)
If you don’t have time for updating all the time, please consider using Zammad hosting for your and your customers’ safety.
- Step 1: Ensure dependencies
Before proceeding, double-check that your system environment matches Zammad’s requirements.
- Step 2: Stop Zammad
$ systemctl stop zammad
- Step 3: Backup Zammad
See Backup and Restore for more information.
- Step 4: Clear Zammad cache
$ zammad run rails r "Rails.cache.clear"
- Step 5: Update Zammad
Note
If you update your complete system and there are updates for Zammad and your database server, this could lead to errors because your database may not be online again when Zammad is updated.
In such a case, you might want to exclude Zammad from updating temporarily as you can see in the commands below.
$ apt update $ apt-mark hold zammad # disable updates for Zammad $ apt upgrade # update all packages except Zammad $ apt-mark unhold zammad # re-enable updates for Zammad $ apt upgrade # update Zammad
$ zypper refresh $ zypper addlock zammad # disable updates for Zammad $ zypper update # update all packages except Zammad $ zypper removelock zammad # re-enable updates for Zammad $ zypper update # update Zammad
$ yum check-update $ yum upgrade --exclude zammad # update all packages except Zammad $ yum upgrade # update Zammad
The package comes with maintenance scripts that will run regular tasks during updates for you. However, you should always have a look at the outputs these helper scripts generate. Ignoring said output may lead to incomplete updates that may corrupt data or lead to issues.
- Step 6: Additional steps
- Check release notes
If not already done, check our release notes if extra steps are necessary and perform them, if applicable.
- Updating Elasticsearch
Updating Elasticsearch may be relevant, too. Make sure to have a supported version of Elasticsearch installed (see software prerequisites for supported versions).
If you have to update Elasticsearch, please have a look at their documentation and follow the instructions.
In case your are using plugins for Elasticsearch, make sure they are updated as well (note: starting with Elasticsearch 8, the ingest-attachment is no longer a plugin, it’s now included in Elasticsearch).
- Step 7: Log into Zammad
Yes, that’s it!
- Step 1: Ensure dependencies
Before proceeding, double-check that your system environment matches Zammad’s requirements.
- Step 2: Stop Zammad and Clear Zammad cache
Before you continue, stop your Zammad processes.
$ rails r "Rails.cache.clear"
- Step 3: Download Zammad to your system
Get the latest stable release of Zammad here. This file will be updated whenever new bug-fixes are applied, so you can update from this URL regularly.
$ cd /opt $ wget https://ftp.zammad.com/zammad-latest.tar.gz $ tar -xzf zammad-latest.tar.gz --strip-components 1 -C zammad $ chown -R zammad:zammad zammad/ $ rm -f zammad-latest.tar.gz
For security reasons, ensure that your database configuration is readable for the Zammad user only.
$ chmod 600 /opt/zammad/config/database.yml $ chown zammad:zammad /opt/zammad/config/database.yml
- Step 4: Install Gems
$ su - zammad $ cd /opt/zammad $ gem install bundler
$ bundle install --without test development mysql
$ bundle install --without test development postgres
Danger
Support for MySQL/MariaDB will be dropped in Zammad 7.0 upwards. Make sure to migrate your existing instance of Zammad to PostgreSQL.
- Step 5: Stop Zammad services
Stop the application server, websocket server and scheduler.
- Step 6: Upgrade your database
$ su - zammad $ rake db:migrate $ rake assets:precompile
- Step 7: Synchronize Zammad’s translation files
$ su - zammad # ignore if you haven't exited the Zammad user $ rails r "Locale.sync" $ rails r "Translation.sync"
- Step 8: Check if Elasticseach update is necessary
Make sure to have a supported version of Elasticsearch installed (see software prerequisites for supported versions).
If you have to update Elasticsearch, please have a look at their documentation and follow the instructions.
In case you are using plugins for Elasticsearch, make sure they are updated as well (note: starting with Elasticsearch 8, the ingest-attachment is no longer a plugin, it’s now included in Elasticsearch).
- Step 9: Start Zammad services
Start the application server, web socket server and scheduler.
- Step 10: Log into Zammad
Yes, that’s it!
Hint
Docker-Compose stack updates may require extra steps or introduce breaking changes. Always check the docker compose release notes for updating instructions first.
- Updating Portainer based Installations
In your Zammad stack, click on Pull and redeploy, activate Re-pull image and redeploy and click on Update.
- Updating Docker-Compose based Installations
$ cd zammad-docker-compose $ git pull $ docker-compose pull $ docker-compose up -d