Welcome to mirror list, hosted at ThFree Co, Russian Federation.

update.tex « main « en « manuals - github.com/bareos/bareos-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e54fb3ca13f872472c91f09fd984481cff9d19c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

In most cases, a Bareos update is simply done by a package update of the distribution.
Please remind, that Bareos Director and Bareos Storage Daemon must always have the same version.
The version of the File Daemon may differ, see chapter about \ilink{backward compatibility}{backward-compability}.

\section{Updating the configuration files}

When updating Bareos through the distribution packaging mechanism,
the existing configuration kept as they are.

If you don't want to modify the behavior,
there is normally no need to modify the configuration.

However, in some rare cases, configuration changes are required.
These cases are described in the \ilink{Release Notes}{releasenotes}.

With Bareos version 16.2.4 the default configuration uses the \nameref{sec:SubdirectoryConfigurationScheme}.
This scheme offers various improvements. However, if your are updating from earlier versions,
your existing single configuration files (\file{/etc/bareos/bareos-*.conf}) stay in place and are contentiously used by Bareos.
The new default configuration resource files will also be installed (\directory{/etc/bareos/bareos-*.d/*/*.conf}).
However, they will only be used, when the legacy configuration file does not exist.

See \nameref{sec:UpdateToConfigurationSubdirectories} for details and how to migrate to \nameref{sec:SubdirectoryConfigurationScheme}.


\section{Updating the database scheme}

Sometimes improvements in Bareos make it necessary to update the database scheme.

\warning{If the Bareos catalog database does not have the current schema, the Bareos Director refuses to start.}

Detailed information can then be found in the log file \logfileUnix.

Take a look into the \ilink{Release Notes}{releasenotes} to see which Bareos updates do require a database scheme update.

\warning{Especially the upgrade to Bareos $\geq$ 17.2.0 restructures the \dbtable{File} database table. In larger installations this is very time consuming and temporarily doubles the amount of required database disk space.}



\subsection{Debian based Linux Distributions}

Since Bareos \sinceVersion{dir}{dbconfig-common (Debian)}{14.2.0} the Debian (and Ubuntu) based packages support the \package{dbconfig-common} mechanism to create and update the Bareos database.
If this is properly configured, the database schema will be automatically adapted by the Bareos packages.

\warning{When using the PostgreSQL backend and updating to Bareos $<$ 14.2.3, it is necessary to manually grant database permissions, normally by using}
\begin{commands}{}
<command> </command><parameter>su - postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges</parameter>
\end{commands}
For details see \nameref{sec:dbconfig}.

If you disabled the usage of \package{dbconfig-common}, 
follow the instructions for \nameref{sec:UpdateDatabaseOtherDistributions}.

\subsection{Other Platforms}
    \label{sec:UpdateDatabaseOtherDistributions}

This has to be done as database administrator.
On most platforms Bareos knows only about the credentials to access the Bareos database,
but not about the database administrator to modify the database schema.

The task of updating the database schema is done by the script
\command{/usr/lib/bareos/scripts/update_bareos_tables}.

However, this script requires administration access to the database.
Depending on your distribution and your database, this requires different preparations.
More details can be found in chapter \ilink{Catalog Maintenance}{CatMaintenanceChapter}.

\warning{If you're updating to Bareos $<=$ 13.2.3 and have configured the Bareos database during install using Bareos environment variables (\variable{db_name}, \variable{db_user} or \variable{db_password}, see \nameref{CatMaintenanceChapter}), make sure to have these variables defined in the same way when calling the update and grant scripts. Newer versions of Bareos read these variables from the Director configuration file \configFileDirUnix. However, make sure that the user running the database scripts has read access to this file (or set the environment variables). The \user{postgres} user normally does not have the required permissions.}

\subsubsection{PostgreSQL}
If your are using PostgreSQL and your PostgreSQL administrator is \user{postgres} (default), use following commands:

\begin{commands}{Update PostgreSQL database schema}
su postgres -c /usr/lib/bareos/scripts/update_bareos_tables
su postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges
\end{commands}

The \command{grant_bareos_privileges} command is required, if new databases tables are introduced. It does not hurt to run it multiple times.

After this, restart the Bareos Director and verify it starts without problems.

\subsubsection{MySQL/MariaDB}
Make sure, that \user{root} has direct access to the local MySQL server.
Check if the command \command{mysql} without parameter connects to the database.
If not, you may be required to adapt your local MySQL configuration file \file{~/.my.cnf}.
It should look similar to this:

\begin{config}{MySQL credentials file .my.cnf}
[client]
host=localhost
user=root
password=<input>YourPasswordForAccessingMysqlAsRoot</input>
\end{config}

If you are able to connect via the \command{mysql} to the database, run the following script from the Unix prompt:
\begin{commands}{Update MySQL database schema}
/usr/lib/bareos/scripts/update_bareos_tables
\end{commands}

Currently on MySQL is it not necessary to run \command{grant_bareos_privileges}, because access to the database is already given using wildcards.

After this, restart the Bareos Director and verify it starts without problems.