Skip to content

Commit

Permalink
docs: remove mentions of MySQL and SQLite catalog
Browse files Browse the repository at this point in the history
This patch removes all mentionings of MySQL and SQLite catalogs from the
documentation, leaving PostgreSQL as the only option.
  • Loading branch information
arogge committed Dec 10, 2021
1 parent f3a0f2e commit b700c2e
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 222 deletions.
4 changes: 0 additions & 4 deletions core/README.dbconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ Upgrade:

Database Permissions by dbconfig:

MySQL:
GRANT USAGE ON *.* TO 'bareos'@'localhost' IDENTIFIED BY PASSWORD '*3E80BB05233BE488EE70C1D6494E2F2DB00FEBB4'
GRANT ALL PRIVILEGES ON `bareos`.* TO 'bareos'@'localhost'

PostgreSQL:
bareos will be the database owner

Expand Down
53 changes: 0 additions & 53 deletions docs/manuals/source/Appendix/BackwardCompatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,59 +90,6 @@ The required commands should look something like this:
usermod -l bareos bacula
groupmod -n bareos bacula
MySQL
^^^^^

Proceed with the following steps:

- Stop bacula services

- Backup your catalog database:

.. code-block:: shell-session
mysqldump bacula > /tmp/bacula_5.2.sql
- 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.

- Install Bareos packages

- Run the update script on the old bacula database:

.. code-block:: shell-session
export db_name=bacula
/usr/lib/bareos/update_bareos_tables
unset db_name
- Backup upgraded DB:

.. code-block:: shell-session
mysqldump bacula > /tmp/bacula.sql
- Create bareos database:

.. code-block:: shell-session
/usr/lib/bareos/create_bareos_database
- Insert backed up db into new database:

.. code-block:: shell-session
cat /tmp/bacula.sql | mysql bareos
- Grant permissions:

.. code-block:: shell-session
/usr/lib/bareos/grant_mysql_privileges
- Adapt file permissions to bareos, if you have any file storage

- Adapt configs (not complete)

PostgreSQL
^^^^^^^^^^

Expand Down
16 changes: 6 additions & 10 deletions docs/manuals/source/Appendix/BareosPrograms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ It is called:
.. code-block:: shell-session
Usage: bscan [options] <Bareos-archive>
-B <driver name> specify the database driver name (default NULL) <postgresql|mysql|sqlite>
-B <driver name> exists for backwards compatibility and is ignored
-b bootstrap specify a bootstrap file
-c <file> specify configuration file
-d <nn> set debug level to nn
Expand All @@ -632,11 +632,9 @@ It is called:
-w <dir> specify working directory (default from conf file)
-? print this message
As Bareos supports loading its database backend dynamically you need to specify the right database driver to use using the -B option.
If you have provided security on your database, you may need to supply either the database name (-b option), the user name (-u option), and/or the password (-p) options.

If you are using MySQL or PostgreSQL, there is no need to supply a working directory since in that case, bscan knows where the databases are. However, if you have provided security on your database, you may need to supply either the database name (-b option), the user name (-u option), and/or the password (-p) options.

NOTE: before :command:`bscan` can work, it needs at least a bare bones valid database. If your database exists but some records are missing because they were pruned, then you are all set. If your database was lost or destroyed, then you must first ensure that you have the SQL program running (MySQL or PostgreSQL), then you must create the Bareos database (normally named bareos), and you must create the Bareos tables. This is explained in :ref:`section-CreateDatabase`
NOTE: before :command:`bscan` can work, it needs at least a bare bones valid database. If your database exists but some records are missing because they were pruned, then you are all set. If your database was lost or destroyed, then you must first ensure that you have PostgreSQL running, then you must create the Bareos database (normally named bareos), and you must create the Bareos tables. This is explained in :ref:`section-CreateDatabase`
chapter of the manual. Finally, before scanning into an empty database, you must start and stop the Director with the appropriate Bareos-dir.conf file so that it can create the Client and Storage records which are not stored on the Volumes. Without these records, scanning is unable to connect the Job records to the proper client.

Forgetting for the moment the extra complications of a full rebuild of your catalog, let’s suppose that you did a backup to Volumes "Vol001" and "Vol002", then sometime later all records of one or both those Volumes were pruned or purged from the database. By using bscan you can recreate the catalog entries for those Volumes and then use the restore command in the Console to restore whatever you want. A command something like:
Expand Down Expand Up @@ -705,7 +703,7 @@ Starting with a single Volume named TestVolume1, you run a command such as:
If there is more than one volume, simply append it to the first one separating it with a vertical bar. You may need to precede the vertical bar with a forward slash escape the shell – e.g. TestVolume1|TestVolume2. The -v option was added for verbose output (this can be omitted if desired). The -s option that tells :command:`bscan` to store information in the database. The physical device name /dev/nst0 is specified after all the options.

For example, after having done a full backup of a directory, then two incrementals, I reinitialized the SQLite database as described above, and using the bootstrap.bsr file noted above, I entered the following command:
For example, after having done a full backup of a directory, then two incrementals, I reinitialized the catalog database as described above, and using the bootstrap.bsr file noted above, I entered the following command:

.. code-block:: shell-session
Expand Down Expand Up @@ -1118,7 +1116,7 @@ If not, problems of reading the Bareos configuration or accessing the database c
-B print catalog configuration and exit
-d <nn> set debug level to <nn>
-dt print a timestamp in debug output
-D <driver name> specify the database driver name (default NULL) <postgresql|mysql|sqlite>
-D <driver name> exists for backwards compatibility and is ignored
-f fix inconsistencies
-v verbose
-? print this message
Expand All @@ -1131,7 +1129,7 @@ If the :strong:`-B` option is specified, :command:`bareos-dbcheck` will print ou
# <input>bareos-dbcheck -B</input>
catalog=MyCatalog
db_type=SQLite
db_type=postgresql
db_name=bareos
db_driver=
db_user=bareos
Expand Down Expand Up @@ -1204,8 +1202,6 @@ The inconsistencies examined are the following:

- All Restore records. This command will remove all Restore records, regardless of their age.

If you are using MySQL, :command:`bareos-dbcheck` in interactive mode will ask you if you want to create temporary indexes to speed up orphaned Path and Filename elimination. In batch mode (:strong:`-b`) the temporary indexes will be created without asking.

If you are using bvfs (e.g. used by :ref:`bareos-webui <section-webui>`), don’t eliminate orphaned path, else you will have to rebuild ``brestore_pathvisibility``\ and ``brestore_pathhierarchy``\ indexes.

Normally you should never need to run :command:`bareos-dbcheck` in spite of the recommendations given above, which are given so that users don’t waste their time running :command:`bareos-dbcheck` too often.
Expand Down
8 changes: 2 additions & 6 deletions docs/manuals/source/Appendix/DisasterRecoveryUsingBareos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,11 @@ Restoring a Bareos Server

Above, we considered how to recover a client machine where a valid Bareos server was running on another machine. However, what happens if your server goes down and you no longer have a running Director, Catalog, or Storage daemon? There are several solutions:

#. Bring up static versions of your Director, Catalog, and Storage daemon on the damaged machine.

#. Move your server to another machine.

#. Use a Hot Spare Server on another Machine.

The first option, is very difficult because it requires you to have created a static version of the Director and the Storage daemon as well as the Catalog. If the Catalog uses MySQL or PostgreSQL, this may or may not be possible. In addition, to loading all these programs on a bare system (quite possible), you will need to make sure you have a valid driver for your tape drive.

The second suggestion is probably a much simpler solution, and one I have done myself. To do so, you might want to consider the following steps:
Consider the following steps:

- Install the same database server as on the original system.

Expand All @@ -173,7 +169,7 @@ The second suggestion is probably a much simpler solution, and one I have done m

- If you have the Bootstrap file, you should now be back up and running, if you do not have a Bootstrap file, continue with the suggestions below.

- Using bscan scan the last set of backup tapes into your MySQL, PostgreSQL or SQLite database.
- Using bscan scan the last set of backup tapes into your catalog database.

- Start Bareos, and using the Console restore command, restore the last valid copy of the Bareos database and the Bareos configuration files.

Expand Down
7 changes: 3 additions & 4 deletions docs/manuals/source/Appendix/Howtos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -980,10 +980,9 @@ Migrate |mysql| to |postgresql|
see: dbcopy; bareos-dbcopy


Since Bareos :sinceVersion:`19.0.0: MySQL Backend is deprecated` the use of |mysql| databases with
Bareos is deprecated. Therefore Bareos provides a tool to conveniently copy the
whole contents to a new |postgresql| database: :ref:`program-bareos-dbcopy`. This
chapter describes how to do a migration using bareos-dbcopy.
Since Bareos :sinceVersion:`21.0.0: MySQL backend removed` the |mysql| database backend is not shipped anymore.
Therefore you will need to upgrade to Bareos 20 first and then copy the whole contents to a new |postgresql| database using :ref:`program-bareos-dbcopy`.
This chapter describes how to do a migration using bareos-dbcopy.

Make a backup of your old database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/manuals/source/Appendix/TheBootstrapFile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ As an example, suppose we query for the current set of tapes to restore all file

::

Using default Catalog name=MySQL DB=bareos
Using default Catalog name=MyCatalog DB=bareos
*query
Available queries:
1: List Job totals:
Expand Down
4 changes: 2 additions & 2 deletions docs/manuals/source/Appendix/Troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Problem
My database is broken.

Solution
For SQLite, use the vacuum command to try to fix the database. For either MySQL or PostgreSQL, see the vendor’s documentation. They have specific tools that check and repair databases, see the :ref:`CatMaintenanceChapter` sections of this manual for links to vendor information.
See the PostgreSQL documentation. They have specific tools that check and repair databases, see the :ref:`CatMaintenanceChapter` sections of this manual for links to vendor information.

Assuming the above does not resolve the problem, you will need to restore or rebuild your catalog. Note, if it is a matter of some inconsistencies in the Bareos tables rather than a broken database, then running :ref:`bareos-dbcheck <bareos-dbcheck>` might help, but you will need to ensure that your database indexes are properly setup.

Expand Down Expand Up @@ -790,7 +790,7 @@ Solution

There are basically three steps to take:

#. Ensure that your SQL server is running (MySQL or PostgreSQL) and that the Bareos database (normally bareos) exists. See the :ref:`section-CreateDatabase` chapter of the manual.
#. Ensure that your PostgreSQL server is running and that the Bareos database (normally bareos) exists. See the :ref:`section-CreateDatabase` chapter of the manual.

#. Ensure that the Bareos databases are created. This is also described at the above link.

Expand Down
14 changes: 5 additions & 9 deletions docs/manuals/source/Configuration/Director.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2038,9 +2038,7 @@ Catalog Resource

:index:`\ <single: Resource; Catalog>`\ :index:`\ <single: Catalog Resource>`\

The Catalog Resource defines what catalog to use for the current job. Currently, Bareos can only handle a single database server (SQLite, MySQL, PostgreSQL) that is defined when configuring Bareos. However, there may be as many Catalogs (databases) defined as you wish. For example, you may want each Client to have its own Catalog database, or you may want backup jobs to use one database and verify or restore jobs to use another database.

Since SQLite is compiled in, it always runs on the same machine as the Director and the database must be directly accessible (mounted) from the Director. However, since both MySQL and PostgreSQL are networked databases, they may reside either on the same machine as the Director or on a different machine on the network. See below for more details.
The Catalog Resource defines what catalog to use for the current job.

.. include:: /include/autogenerated/bareos-dir-resource-catalog-table.rst.inc

Expand All @@ -2049,12 +2047,11 @@ Since SQLite is compiled in, it always runs on the same machine as the Director
The following is an example of a valid Catalog resource definition:

.. code-block:: bareosconfig
:caption: Catalog Resource for Sqlite
:caption: Catalog Resource for MyCatalog
Catalog
{
Name = SQLite
DB Driver = sqlite
Name = MyCatalog
DB Name = bareos;
DB User = bareos;
DB Password = ""
Expand All @@ -2063,12 +2060,11 @@ The following is an example of a valid Catalog resource definition:
or for a Catalog on another machine:

.. code-block:: bareosconfig
:caption: Catalog Resource for remote MySQL
:caption: Catalog Resource for remote PostgreSQL
Catalog
{
Name = MySQL
DB Driver = mysql
Name = RemoteCatalog
DB Name = bareos
DB User = bareos
DB Password = "secret"
Expand Down
5 changes: 0 additions & 5 deletions docs/manuals/source/DeveloperGuide/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,6 @@ General notes
- Due to potential encoding problem, it’s advised to use ``pathid``
instead of ``path`` in queries.

.. limitation:: BVFS: bvfs_lsdirs limit/offset not working correctly on MySQL

As described in :mantis:`975` the limit/offset does not work correctly for bvfs_lsdirs on MySQL.
The problem has been fixed for PostgreSQL, but the SQL syntax required to formulate the query is unavailable on MySQL so there is no easy way to replicate that fix on MySQL.

Get dependent jobs from a given JobId
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
36 changes: 7 additions & 29 deletions docs/manuals/source/DeveloperGuide/catalog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,21 @@ services and as such is not targeted at end users but rather at
developers and system administrators who want or need to know more of
the working details of **Bareos**.

Currently, we prefer the usage of PostgreSQL. Therefore our support
for SQLite or other databases could be discontinued in the future.
PostgreSQL was chosen because it is a full-featured, very mature database,
and because Dan Langille did the Bareos driver for it.

SQLite was chosen because it is small, efficient, and can be directly
embedded in **Bareos** thus requiring much less effort from the system
administrator or person building **Bareos**. In our testing SQLite has
performed very well, and for the functions that we use, it has never
encountered any errors except that it does not appear to handle
databases larger than 2GBytes. That said, we would not recommend it for
serious production use. Nonetheless SQLite is very suitable for test
environments.

Bareos **requires** one of the three databases (MySQL, PostgreSQL, or SQLite)
to run. Therefore it is mandatory to specify one of them for the cmake
configuration step, i.e.: ``-Dpostgresql=yes``.
We only support PostgreSQL.
Support for SQLite or MySQL has been discontinued in :sinceVersion:`21.0.0:MySQL backend removed`.
PostgreSQL was chosen because it is a full-featured, very mature database.

Filenames and Maximum Filename Length
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In general, either MySQL, PostgreSQL or SQLite permit storing arbitrary
long path names and file names in the catalog database. In practice,
there still may be one or two places in the catalog interface code that
restrict the maximum path length to 512 characters and the maximum file
name length to 512 characters. These restrictions are believed to have
been removed. Please note, these restrictions apply only to the catalog
database and thus to your ability to list online the files saved during
any job. All information received and stored by the Storage daemon
(normally on tape) allows and handles arbitrarily long path and
filenames.
In general, PostgreSQL permit storing arbitrary long path names and file names in the catalog database.
However, PostgreSQL limits the maximum length of an index item to 2730, which will affect the length of a path (without the filename) that can be stored in the catalog database. Nevertheless, the 2730 is not a hard limit as PostgreSQL will apply some lossless compression to strings before adding them to its index.

The guarantee is, that you will be able to store paths at least 2730 bytes long. You may or may not run into PostgreSQL index errors when using longer paths.

Database Table Design
~~~~~~~~~~~~~~~~~~~~~

All discussions that follow pertain to the PostgreSQL database.

Because the catalog database may contain very large amounts of data for
large sites, we have made a modest attempt to normalize the data tables
to reduce redundant information. While reducing the size of the database
Expand Down
29 changes: 2 additions & 27 deletions docs/manuals/source/IntroductionAndTutorial/InstallingBareos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,11 @@ The public key to verify the repository is also in repository directory (:file:`

Section :ref:`section-InstallBareosPackages` describes how to add the software repository to your system.


.. _section-ChooseDatabaseBackend:

Decide about the Database Backend
---------------------------------

Bareos offers the following database backends:

PostgreSQL
This is the preferred default database backend. It is contained in package **bareos-database-postgresql**.
If you need to think about which backend to use, this is your choice!

MariaDB/MySQL
.. deprecated:: 19.0.0

This backend is provided only for backwards compatibility with existing MariaDB/MySQL deployments.
It is contained in package **bareos-database-mysql**.
**This is not the right choice for a new deployment.**

SQLite
.. deprecated:: 20.0.0

This backend is for testing purposes only.
It is contained in package **bareos-database-sqlite3**.
**Do not use this in production.**

Bareos requires a PostgreSQL database as its catalog.
The backend is contained in package **bareos-database-postgresql**.
The Bareos database packages have their dependencies only to the database client packages, therefore the database itself must be installed manually.



.. _section-InstallBareosPackages:

Install the Bareos Software Packages
Expand Down
7 changes: 1 addition & 6 deletions docs/manuals/source/IntroductionAndTutorial/Tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This chapter will guide you through running Bareos. To do so, we assume you have

The general flow of running Bareos is:

#. Start the Database (if using |postgresql| or |mysql|)
#. Start the Database

#.

Expand All @@ -27,11 +27,6 @@ The general flow of running Bareos is:

Each of these steps is described in more detail below.

Starting the Database
---------------------

If you are using |postgresql| or |mysql| as the Bareos database, you should start it before you install Bareos. If you are using |sqlite| you need do nothing. |sqlite| is automatically started by the |dir|.

Installing Bareos
-----------------

Expand Down

0 comments on commit b700c2e

Please sign in to comment.