Skip to content

Commit 8c825f8

Browse files
committed
docs/04-Upgrading.md: Database Schema Upgrades
A new section on how to actually apply the database schema upgrade was introduced. This new section should take a user's fear to mess up a schema upgrade. Fixes #926.
1 parent c2778d3 commit 8c825f8

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

doc/04-Upgrading.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
11
# Upgrading Icinga DB
22

3-
Specific version upgrades are described below. Please note that version upgrades are incremental.
4-
If you are upgrading across multiple versions, make sure to follow the steps for each of them.
3+
Some Icinga DB upgrades require manual intervention, others do not. If you need to intervene, the release notes will
4+
point you to the specific upgrade section on this page.
5+
6+
Please note that version upgrades are incremental. If you are upgrading across multiple versions, make sure to follow
7+
the steps for each of them.
8+
9+
## Database Schema Upgrades
10+
11+
Certain Icinga DB version upgrades require a database schema upgrade. If the upgrade section of the specific Icinga DB
12+
release mentions a schema upgrade, this section will guide you through the process of applying the schema upgrade.
13+
14+
First, stop the Icinga DB daemon. If you have an HA setup, stop all Icinga DB instances.
15+
16+
```
17+
systemctl stop icingadb
18+
```
19+
20+
Locate the required schema upgrade files in `/usr/share/icingadb/schema/mysql/upgrades/` for MySQL/MariaDB or in
21+
`/usr/share/icingadb/schema/pgsql/upgrades/` for PostgreSQL. The schema upgrade files are named after the new Icinga DB
22+
release and are mentioned in the specific section below. If you have skipped multiple Icinga DB releases, apply all
23+
schema versions in their order, starting with the earliest release.
24+
25+
The following commands would apply the 1.2.1 schema upgrade to the `icingadb` database as the `icingadb` user. Please
26+
modify them for your setup and the schema upgrade you want to apply.
27+
28+
* MySQL/MariaDB:
29+
```
30+
mysql -u icingadb -p icingadb < /usr/share/icingadb/schema/mysql/upgrades/1.2.1.sql
31+
```
32+
* PostgreSQL:
33+
```
34+
psql -U icingadb icingadb < /usr/share/icingadb/schema/pgsql/upgrades/1.2.1.sql
35+
```
36+
37+
Afterwards, restart Icinga DB. If you have an HA setup, restart all Icinga DB instances.
38+
39+
```
40+
systemctl start icingadb
41+
```
542

643
## Upgrading to Icinga DB v1.2.1
744

0 commit comments

Comments
 (0)