/
backward-compatibility.tex
177 lines (142 loc) · 6.88 KB
/
backward-compatibility.tex
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
\chapter{Backward Compatibility}
\index[general]{Compatibility!Backward}
\label{backward-compatibility}
\section{Tape Formats}
\index[general]{Tape!Format}
\label{backward-compatibility-tape-format}
One of the major goals of Backup software is to ensure that you can restore
tapes (the word tape should also include disk volumes) that you wrote years
ago. This means that each new version of the software should be able to read old
format tapes. The first problem you will have is to ensure that the
hardware is still working some years down the road, and the second
problem will be to ensure that the media will still be good, then
your OS must be able to interface to the device, and finally Bareos
must be able to recognize old formats. All the problems except the
last are ones that we cannot solve, but by careful planning you can.
Since the very beginning of Bacula (January 2000) until today (2015),
there have been three major Bacula/Bareos tape formats. The second format
was introduced in Bacula version 1.27 in November of 2002.
Bareos has been required to adapt the tape format to avoid potential trademark issues,
but is able to read also the old Bacula tape formats.
Though the tape format is basically fixed, the kinds of data that we can put on the
tapes are extensible, and that is how we added new features
such as ACLs, Win32 data, encrypted data, ... Obviously, an older
version of Bacula/Bareos would not know how to read these newer data streams,
but each newer version of Bareos should know how to read all the
older streams.
% If you want to be 100% sure that you can read old tapes, you
% should:
%
% 1. Try reading old tapes from time to time -- e.g. at least once
% a year.
%
% 2. Keep statically linked copies of every version of Bareos that you use
% in production then if for some reason, we botch up old tape compatibility, you
% can always pull out an old copy of Bareos ...
%
% The second point is probably overkill but if you want to be sure, it may
% save you someday.
\section{Compatibility between Bareos and Bacula}
\index[general]{Compatibility!Bacula}
\index[general]{Bacula}
\label{compat-bacula}
A Director and a Storage Daemon should (must) always run at the same version.
This is true for Bareos as well as for Bacula.
It is not possible to mix these components.
This is because the protocol between Director and Storage Daemon itself is not versioned (also true for Bareos and Bacula).
If you want to be able to switch back from Bareos to Bacula after using a Bareos director and storage daemon
you have to enable the compatible mode in the Bareos storage daemon to have it write the data in the same
format as the Bacula storage daemon.
The \bareosFd is compatible with all version of the Bacula director (tested with version 5.2.13 and lower)
when you enable the compatible mode in the configuration of the \bareosFd.
The compatible option was set by default in Bareos $<$ 15.2.0, and is disabled by default since
\sinceVersion{fd}{Compatible = no}{15.2.0}.
To be sure this is enabled you can explicitly set the compatible option:
\resourceDirectiveValue{Fd}{Client}{Compatible}{True}
A \bareosDir can only talk to Bacula file daemons of version 2.0 or higher.
Through a change in the Bacula network protocols,
it is currently not possible to use a Bacula file daemon $\ge$ 6.0 with a \bareosDir.
\newcommand{\bareoscolor}{\textcolor{blue}{Bareos\ }}
\newcommand{\baculacolor}{\textcolor{red}{Bacula\ }}
These combinations of Bareos and Bacula are know to work together:
\begin{tabular}[h]{|l|l|l|l|}
\hline
\textbf{Director} & \textbf{Storage Daemon} & \textbf{File Daemon} & \textbf{Remarks} \\
\hline
\hline
\bareoscolor & \bareoscolor & \bareoscolor & \\
\hline
\bareoscolor & \bareoscolor & 2.0 $\leq$ \baculacolor $<$ 6.0 & \\
\hline
\baculacolor & \baculacolor & \baculacolor & \\
\hline
\baculacolor & \baculacolor & \bareoscolor (compatibility mode) & \\
\hline
\end{tabular}
Other combinations like Bacula Director with \bareosSd will not work.
However this wasn't even possible with different versions of bacula-dir and bacula-sd.
\subsection{Upgrade from Bacula 5.2 to Bareos}
\index[general]{Upgrade from Bacula to Bareos}
\index[general]{Bareos!Upgrading}
\label{upgrade-from-bacula-to-bareos}
Upgrade is supported from Bacula version 5.2.x. If you are running any older version of Bacula, please update to 5.2 first (see Bacula documentation).
\warning{Updating from Bacula $\geq$ 7.0 to Bareos has not been tested.}
\warning{As Bareos and Bacula packages bring binaries with identical paths and names,
it is on most platforms not possible to install components from both in parallel.
Your package management tool will warn you about this.}
\subsubsection{Rename user and group before upgrading}
To have bareos running without any permission hassle, it is recommended to rename the user and group \user{bacula} to the user and group \user{bareos} before upgrading. That way, we minimize the effort for the user to recheck all config files and the rights on every script/directory etc. involved in the existing setup.
The required commands should look something like this:
\begin{commands}{}
usermod -l bareos bacula
groupmod -n bareos bacula
\end{commands}
\subsubsection{MySQL}
Proceed with the following steps:
\begin{itemize}
\item Stop bacula services
\item Backup your catalog database:
\begin{commands}{}
mysqldump bacula > /tmp/bacula_5.2.sql
\end{commands}
\item Make the user bareos have the same userid and the group bareos the same groupid as the user/group bacula had before. This will solve a lot of rights problems.
\item Install Bareos packages
\item Run the update script on the old bacula database:
\begin{commands}{}
export db_name=bacula
/usr/lib/bareos/update_bareos_tables
unset db_name
\end{commands}
\item Backup upgraded DB:
\begin{commands}{}
mysqldump bacula > /tmp/bacula.sql
\end{commands}
\item Create bareos database:
\begin{commands}{}
/usr/lib/bareos/create_bareos_database
\end{commands}
\item Insert backuped db into new database:
\begin{commands}{}
cat /tmp/bacula.sql | mysql bareos
\end{commands}
\item Grant permissions:
\begin{commands}{}
/usr/lib/bareos/grant_mysql_privileges
\end{commands}
\item Adapt file permissions to bareos, if you have any file storage
\item Adapt configs (not complete)
\begin{itemize}
\item With bacula the default setting for pid files was \path|/var/run|, which may not work if the bareos-director runs as user bareos. Best way is to comment out the entry \command{Pid Directory = "/var/run"} in your director config. Bareos will set a working default value (supposed to be \path|/var/lib/bareos/|)
\end{itemize}
\end{itemize}
\subsubsection{PostgreSQL}
Renaming a postgresql database:
\begin{itemize}
\item Become postgresql user
\item psql template1
\begin{commands}{}
ALTER DATABASE bacula RENAME TO bareos;
ALTER USER bacula RENAME TO bareos;
ALTER USER bareos UNENCRYPTED PASSWORD 'password';
\end{commands}
\end{itemize}