postgresql
postgresql
Document
SQL file if you are using some features that are not available on the previous version. Generally,
restoring to a previous version of PostgreSQL is not supported or not guaranteed.
With the above example, the module will detect and backup all databases of the
Cluster.
FileSet {
Name = fs_postgresql
Include {
Options {
Signature = MD5
Compression = GZIP
}
Plugin = "postgresql: database=bacula"
Plugin = "postgresql: database=master"
}
}
In this example, the module will backup only the databases “bacula” and “master ”
In Dump mode, the PostgreSQL module also accepts the parameters listed in table
below:
4 The dump_opt option cannot be used to backup remote servers. Please use PGSERVICE
instead
5 Available with Bacula Enterprise 8.4.12 and later
FileSet {
Name = fs_postgresql_dump
Include {
Options {
Signature = MD5
}
Plugin = "postgresql: use_sudo user=rob dump_opt=\"-T temp\""
}
}
In this example, the PostgreSQL plugin will use the Unix account rob to perform a
Custom Dump backup with the PostgreSQL “rob” account excluding tables named
“temp”
The next steps should be to verify that the Bacula PostgreSQL module can retrieve
information using the psql command as “postgres” user on the Client.
To verify if the “postgres” user can connect to the PostgreSQL Cluster, the psql
-l command can be used, and it should list all databases in the Cluster:
postgres% psql -l
List of databases
Name | Owner |
-----------+----------+
postgres | xxx
template0 | xxx
template1 | xxx
If options such as -h localhost are needed on the psql command line, a service
file as described in servicecon will be required.
9 Estimate Information
The estimate command will display all information found by the PostgreSQL mod-
ule. Note that in Dump mode, Bacula can not compute the Dump size for databases,
so it will display database size instead.
@PG/main/test/createdb.sql
@PG/main/test/schema.sql
@PG/main/test/data.sqlc
11 Restore Scenarios
11.1 Restoring Using Dumps
11.1.1 Restoring Users and Roles
To restore roles and users to a PostgreSQL Cluster, the roles.sql file located in
/@PG/<service>/roles.sql needs to be selected.
Then, using ............
where=/ or ..........
where= the module will load this SQL file to the database.
If some roles already exist, errors will be printed to the Job log. Note that it is
possible to restore the roles.sql file to a local directory, edit it, and load it using
psql to restore only a selection of its original contents.
◾ Volume size
The details of these selection criteria will be defined below.
To run a Migration job, you must first define a Job resource very similar to a Backup
Job but with Type = Migrate directive instead of Type = Backup directive. One
of the key points to remember is that the Pool that is specified for the migration
job is the only pool from which jobs will be migrated, with one exception noted
below. In addition, the Pool to which the selected Job or Jobs will be migrated is
defined by the Next Pool = . . . directive in the Pool resource specified for the
Migration Job.
Bacula permits Pools to contain Volumes with different Media Types. However,
when doing migration, this is a very undesirable condition. For migration to work
properly, you should use Pools containing only Volumes of the same Media Type
for all migration jobs.
The migration job normally is either manually started or starts from a Schedule
much like a backup job. It searches for a previous backup Job or Jobs that match
the parameters you have specified in the migration Job resource, primarily a Selec-
tion Type (detailed a bit later). Then for each previous backup JobId found, the
Migration Job will run a new Job which copies the old Job data from the previ-
ous Volume to a new Volume in the Migration Pool. It is possible that no prior
Jobs are found for migration, in which case, the Migration job will simply terminate
having done nothing, but normally at a minimum, three jobs are involved during a
migration:
◾ The currently running Migration control Job. This is only a control job for
starting the migration child jobs.
◾ The previous Backup Job (already run). The File records for this Job are
purged if the Migration job successfully terminates. The original data remains
on the Volume until it is recycled and rewritten.
◾ A new Migration Backup Job that moves the data from the previous Backup
job to the new Volume. If you subsequently do a restore, the data will be
read from this Job.
◾ Natively integrated support for Docker (and its external volumes) and Kuber-
netes, including persistent data
◾ Continuous Data Protection
◾ Data encryption cipher (AES 128, AES192, AES256 or blowfish) and the
digest algorithm
◾ Automatic use of TLS for all network communications (can be turned off)
◾ Verification of files previously catalogued, permitting a Tripwire-like capability
(system break-in detection)
◾ The client is not aware of storage targets and has no credentials for accessing
them
◾ Storage and SD (Bacula’s Storage Daemon) host are dedicated systems,
strictly secured, only allowing Bacula-related traffic and admin access – noth-
ing else.
16 Conclusion
Bacula Enterprise is designed to facilitate positive change within any demanding
organization’s IT infrastructure. Its especially broad compatibility – not just with
many databases such as PostgeSQL, but also multiple VM-types, Containers and
Cloud environments - helps remove barriers, while its modularity and flexibility help
improve agility to speed new capabilities into the field. In an environment where new
policies, processes and culture change are planned – or even in process - Bacula’s
flexibility and resilience enable IT leaders to future-proof the backup and recovery
aspect of their strategy while at the same time exploit the significantly lower risk
that Bacula’s architecture represents for new deployments.
An organization’s backup and recovery system(s) has a critical need to be robust
from attack. Bacula has especially high levels of security compared to other backup
and recovery vendors. In additional to this, Bacula itself, - unlike many other
solutions - runs on Linux. As a result, it offers a higher degree of inherent security
and robustness.
Bacula’s approach allows all organizations and businesses to protect more environ-
ments, with more security, much faster and with lower risk than they ever have
before. Please contact Bacula for a demonstration of its PostgreSQL advanced
capabilities.
Contact
.......... Bacula Systems today to learn more on how Bacula can benefit you and
8
8 https://www.baculasystems.com/contactus/
..........................................................