You can protect your AlloyDB Omni data using any database backup technology that works with PostgreSQL. For example, you can configure AlloyDB Omni to allow
connections from a Barman server that you control. This enables the Barman server to perform continuous backups of the data stored in your AlloyDB Omni server.
After you configure your Barman and AlloyDB Omni servers to work together, you can subsequentlyrun Barman commandsto accomplish a variety of data-protection and disaster-recovery tasks, including the following:
Create an on-demand backup of your data.
Set up synchronous WAL streaming of your data changes to your backup server.
Restore from a specific backup.
Perform a point-in-time restoration.
For more information about the operation of Barman, seethe Barman manual.
Before you begin
Before configuring AlloyDB Omni to work with Barman, you need the following:
Barman installedon a separate server. The server that you installed Barman on must be able to communicate with the AlloyDB Omni server over TCP.
Configure AlloyDB Omni to work with Barman
To prepare your AlloyDB Omni server to work with Barman, run the following commands on the server where you have
installed AlloyDB Omni.
Create thebarmandatabase user, with the appropriate privileges:
/usr/lib/postgresql/18/bin/psql -h localhost -U postgres -c "
CREATE USER barman;
GRANT EXECUTE ON FUNCTION pg_backup_start(text, boolean) to barman;
GRANT EXECUTE ON FUNCTION pg_backup_stop(boolean) to barman;
GRANT EXECUTE ON FUNCTION pg_switch_wal() to barman;
GRANT EXECUTE ON FUNCTION pg_create_restore_point(text) to barman;
GRANT pg_read_all_settings TO barman;
GRANT pg_read_all_stats TO barman;
CREATE USER streaming_barman WITH REPLICATION;
GRANT pg_read_all_settings TO streaming_barman;
"
Add the following lines in theDATA_DIR/pg_hba.conffilebeforethe `host all all all * line that exists in the file:
host all barmanBARMAN_IP/32AUTHN_METHODhost replication streaming_barmanBARMAN_IP/32AUTHN_METHOD
Replace the following:
DATA_DIR: the file system path used for the AlloyDB Omni data directory.
BARMAN_IP: the IP address of the Barman server.
AUTHN_METHOD: the PostgreSQL authentication method
that your AlloyDB for PostgreSQL server expects from the Barman server.
We recommend one of the following values:
To allow the Barman server to authenticate without a password, usetrust.
To require a password from the Barman server, usescram-sha-256.
Add the following lines to theDATA_DIR/postgresql.conffile:
Confirm the necessary parameters are all set appropriately by running
the following command:
/usr/lib/postgresql/18/bin/psql -h localhost -U postgres -c "
SELECT name, setting
FROM pg_catalog.pg_settings
WHERE name IN ('archive_command',
'archive_mode',
'listen_addresses',
'wal_level')
ORDER BY name;"
The output is as follows:
name | setting
------------------|-----------
archive_command | /bin/true
archive_mode | on
listen_addresses | *
wal_level | replica
(4 rows)
Set up the Barman backup server
To set up and configure Barman to work with your AlloyDB Omni server,
run the following commands on your Barman server.
Verify that the streaming replication connection works:
ReplaceCONFIGURATION_TAGwith the configuration tag that you chose in the previous step.
Barman is now configured to work with your AlloyDB Omni server.
To check the replication status, create manual backups, and perform other tasks,
seeGeneral commands.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-04-16 UTC."],[],[]]