1.. _backward-compatibility:
2
3Backward Compatibility
4======================
5
6:index:`\ <single: Compatibility; Backward>`\
7
8
9.. _backward-compatibility-tape-format:
10
11Tape Formats
12------------
13
14:index:`\ <single: Tape; Format>`\
15
16One 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
17Bareos 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.
18
19Since 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.
20
21Though 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.
22
23
24.. _compat-bacula:
25
26Compatibility between Bareos and Bacula
27---------------------------------------
28
29:index:`\ <single: Compatibility; Bacula>`
30:index:`\ <single: Bacula>`
31
32A 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
33the same format as the Bacula storage daemon.
34
35The |fd| 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 |fd|. The compatible option was set by default in Bareos < 15.2.0, and is disabled by default since :sinceVersion:`15.2.0: Compatible = no`.
36
37To be sure this is enabled you can explicitly set the compatible option:
38
39:config:option:`fd/client/Compatible = True`\
40
41A |dir| 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 > 6.0 with a |dir|.
42
43These combinations of Bareos and Bacula are know to work together:
44
45============ ================== =========================== ===========
46**Director** **Storage Daemon** **File Daemon**             **Remarks**
47============ ================== =========================== ===========
48Bareos       Bareos             Bareos 
49Bareos       Bareos             2.0 <= Bacula < 6.0
50Bacula       Bacula             Bacula 
51Bacula       Bacula             Bareos (compatibility mode)
52============ ================== =========================== ===========
53
54Other combinations like Bacula Director with |sd| will not work. However this wasn’t even possible with different versions of bacula-dir and bacula-sd.
55
56.. _upgrade-from-bacula-to-bareos:
57
58Upgrade from Bacula 5.2 to Bareos
59~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
61:index:`\ <single: Upgrade from Bacula to Bareos>`
62:index:`\ <single: Bareos; Upgrading>`
63
64Upgrade 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).
65
66
67
68.. warning::
69
70   Updating from Bacula >= 7.0 to Bareos has not been tested.
71
72
73
74.. warning::
75
76   As Bareos and Bacula packages bring binaries with identical paths and names,
77   it is on most platforms not possible to install components from both in parallel.
78   Your package management tool will warn you about this.
79
80
81Rename user and group before upgrading
82^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83
84To have bareos running without any permission hassle, it is recommended to rename the user and group **bacula** to the user and group **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.
85
86The required commands should look something like this:
87
88.. code-block:: shell-session
89
90   usermod  -l bareos bacula
91   groupmod -n bareos bacula
92
93MySQL
94^^^^^
95
96Proceed with the following steps:
97
98-  Stop bacula services
99
100-  Backup your catalog database:
101
102   .. code-block:: shell-session
103
104      mysqldump bacula > /tmp/bacula_5.2.sql
105
106-  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.
107
108-  Install Bareos packages
109
110-  Run the update script on the old bacula database:
111
112   .. code-block:: shell-session
113
114      export db_name=bacula
115      /usr/lib/bareos/update_bareos_tables
116      unset db_name
117
118-  Backup upgraded DB:
119
120   .. code-block:: shell-session
121
122      mysqldump bacula > /tmp/bacula.sql
123
124-  Create bareos database:
125
126   .. code-block:: shell-session
127
128      /usr/lib/bareos/create_bareos_database
129
130-  Insert backed up db into new database:
131
132   .. code-block:: shell-session
133
134      cat /tmp/bacula.sql | mysql bareos
135
136-  Grant permissions:
137
138   .. code-block:: shell-session
139
140      /usr/lib/bareos/grant_mysql_privileges
141
142-  Adapt file permissions to bareos, if you have any file storage
143
144-  Adapt configs (not complete)
145
146   -  With bacula the default setting for pid files was :file:`/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 :file:`/var/lib/bareos/`)
147
148PostgreSQL
149^^^^^^^^^^
150
151Renaming a postgresql database:
152
153-  Become postgresql user
154
155-  psql template1
156
157   .. code-block:: shell-session
158
159      ALTER DATABASE bacula RENAME TO bareos;
160      ALTER USER bacula RENAME TO bareos;
161      ALTER USER bareos UNENCRYPTED PASSWORD 'password';
162