]> granicus.if.org Git - icinga2/blob - doc/16-upgrading-icinga-2.md
Ensure that the cache directory always is set and add a note to upgrading docs
[icinga2] / doc / 16-upgrading-icinga-2.md
1 # Upgrading Icinga 2 <a id="upgrading-icinga-2"></a>
2
3 Upgrading Icinga 2 is usually quite straightforward. Ordinarily the only manual steps involved
4 are scheme updates for the IDO database.
5
6 ## Upgrading to v2.8 <a id="upgrading-to-2-8"></a>
7
8 The default certificate path was changed from `/etc/icinga2/pki` to
9 `/var/lib/icinga2/certs`.
10
11 This applies to Windows clients in the same way: `%ProgramData%\etc\icinga2\pki`
12 was moved to `%ProgramData%`\var\lib\icinga2\certs`.
13
14 The [setup CLI commands](06-distributed-monitoring.md#distributed-monitoring-setup-master) and the
15 default [ApiListener configuration](06-distributed-monitoring.md#distributed-monitoring-apilistener)
16 have been adjusted to these paths too.
17
18 ## Upgrading to v2.7 <a id="upgrading-to-2-7"></a>
19
20 v2.7.0 provided new notification scripts and commands. Please ensure to
21 update your configuration accordingly. An advisory has been published [here](https://www.icinga.com/2017/08/23/advisory-for-icinga-2-v2-7-update-and-mail-notification-scripts/).
22
23 In case are having troubles with OpenSSL 1.1.0 and the
24 public CA certificates, please read [this advisory](https://www.icinga.com/2017/08/30/advisory-for-ssl-problems-with-leading-zeros-on-openssl-1-1-0/)
25 and check the [troubleshooting chapter](15-troubleshooting.md#troubleshooting).
26
27 If Icinga 2 fails to start with an empty reference to `$ICINGA2_CACHE_DIR`
28 ensure to set it inside `/etc/sysconfig/icinga2` (RHEL) or `/etc/default/icinga2` (Debian).
29
30 RPM packages will put a file called `/etc/sysconfig/icinga2.rpmnew`
31 if you have modified the original file.
32
33 Example on CentOS 7:
34
35 ```
36 vim /etc/sysconfig/icinga2
37
38 ICINGA2_CACHE_DIR=/var/cache/icinga2
39
40 systemctl restart icinga2
41 ```
42
43 ## Upgrading the MySQL database <a id="upgrading-mysql-db"></a>
44
45 If you're upgrading an existing Icinga 2 instance, you should check the
46 `/usr/share/icinga2-ido-mysql/schema/upgrade` directory for an incremental schema upgrade file.
47
48 > **Note**
49 >
50 > If there isn't an upgrade file for your current version available, there's nothing to do.
51
52 Apply all database schema upgrade files incrementally.
53
54     # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/upgrade/<version>.sql
55
56 The Icinga 2 DB IDO module will check for the required database schema version on startup
57 and generate an error message if not satisfied.
58
59
60 **Example:** You are upgrading Icinga 2 from version `2.0.2` to `2.3.0`. Look into
61 the *upgrade* directory:
62
63     $ ls /usr/share/icinga2-ido-mysql/schema/upgrade/
64     2.0.2.sql  2.1.0.sql 2.2.0.sql 2.3.0.sql
65
66 There are two new upgrade files called `2.1.0.sql`, `2.2.0.sql` and `2.3.0.sql`
67 which must be applied incrementally to your IDO database.
68
69 ## Upgrading the PostgreSQL database <a id="upgrading-postgresql-db"></a>
70
71 If you're updating an existing Icinga 2 instance, you should check the
72 `/usr/share/icinga2-ido-pgsql/schema/upgrade` directory for an incremental schema upgrade file.
73
74 > **Note**
75 >
76 > If there isn't an upgrade file for your current version available, there's nothing to do.
77
78 Apply all database schema upgrade files incrementally.
79
80     # export PGPASSWORD=icinga
81     # psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/upgrade/<version>.sql
82
83 The Icinga 2 DB IDO module will check for the required database schema version on startup
84 and generate an error message if not satisfied.
85
86 **Example:** You are upgrading Icinga 2 from version `2.0.2` to `2.3.0`. Look into
87 the *upgrade* directory:
88
89     $ ls /usr/share/icinga2-ido-pgsql/schema/upgrade/
90     2.0.2.sql  2.1.0.sql 2.2.0.sql 2.3.0.sql
91
92 There are two new upgrade files called `2.1.0.sql`, `2.2.0.sql` and `2.3.0.sql`
93 which must be applied incrementally to your IDO database.