bareos-dbcopy

Synopsis

bareos-dbcopy [options] <sourcecatalog> <destinationcatalog>

Description

bareos-dbcopy copies the data of all tables from the Bareos catalog <sourcecatalog> into the Bareos catalog <destinationcatalog>.

By default bareos-dbcopy reads the Bareos Director configuration from /etc/bareos to load the catalog settings. A configuration resource for both <sourcecatalog> and <destinationcatalog> must exist.

The main purpose of bareos-dbcopy is to migrate an existing Bareos installation from MySQL/MariaDB to PostgreSQL. Therefore the required DB Driver (Dir->Catalog) in the <sourcecatalog> is MySQL/MariaDB, and for <destinationcatalog> only PostgreSQL is possible.

bareos-dbcopy only copies the data over to the new catalog. The <destinationcatalog> needs to be created and initialized with the correct tables and columns via create_bareos_database, make_bareos_tables and grant_bareos_privileges.

Both sourcecatalog and destinationcatalog need to have the same database scheme version, i.e. have the schema from the identical Bareos version.

For more information please read the according HowTo in the bareos documentation.

https://docs.bareos.org/

Internal workflow

  • bareos-dbcopy scans both the source and destination database for existing tables and column definitions.
  • For each table, each row is transferred from the source to the destination database. Depending on the column type, data filters are applied.
  • Tables existing in the source database but not in the destination database are skipped.
  • If a destination table already contains data, then this table is skipped.

Options

-c <configuration directory>

bareos-dbcopy reads the Bareos Director configuration from the given <configuration directory> instead of /etc/bareos

-i

By default all rows are inserted into the PostgreSQL database by COPY FROM STDIN. This flag overrides the default and inserts all rows by INSERT INTO statements. Because this runs much slower it should only be used in case of errors.

-?

Prints usage information