Because AlloyDB Omni is compatible with PostgreSQL,
the data-restoration commands and techniques described by the Barman manual
apply to AlloyDB Omni as well. This page demonstrates a selection
of common recovery tasks, with examples of relevant commands.
Before restoring your AlloyDB Omni data, you need
the following:
A target database server, running the same major version of AlloyDB Omni as the source database server. For more information about installing AlloyDB Omni, see Install AlloyDB Omni.
The target server can be the same machine as the source server.
The rsync utility, installed on the target server.
A Barman backup server, with at least one valid Barman backup of the source AlloyDB Omni database on it.
SSH connectivity between the Barman backup server and the target server.
SSH keys set up to allow the barman user on the Barman server to authenticate
with the target server as its postgres user without a password.
Enough free disk space on the target server to hold the restored database.
Recover using a specific backup
On the target server, stop AlloyDB Omni.
Docker
dockerstopCONTAINER_NAME
Replace CONTAINER_NAME with the name that you assigned to the AlloyDB Omni container when you installed it—for example, my-omni.
Podman
podmanstopCONTAINER_NAME
Replace CONTAINER_NAME with the name that you assigned to the AlloyDB Omni container when you installed it—for example, my-omni.
TARGET_LABEL: the label that you assigned to the server in Barman's configuration file.
BACKUP_ID: the ID of the backup to restore from, identified in a previous step—for example, 20230810T210200.
DATA_PATH: the path to the data subdirectory of the target server's data directory—for example, /home/your-username/alloydb-data/data.
On the AlloyDB Omni target database server, start the
service:
Docker
dockerstartCONTAINER_NAME
Podman
podmanstartCONTAINER_NAME
After the service restarts, connect to your AlloyDB Omni server.
You should see your restored databases and data.
Recover to a specific point in time
To perform a point-in-time recovery, follow the same steps listed in the previous section, with one
modification. When you run the barman recover command, you must also specify one of the Barman point-in-time recovery options.
The following command demonstrates an example use of barman recover with AlloyDB Omni with
a point-in-time recovery option:
[[["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 2025-08-28 UTC."],[[["\u003cp\u003eThis page guides users on restoring an AlloyDB Omni cluster using backups created with Barman, an open-source database backup server.\u003c/p\u003e\n"],["\u003cp\u003eThe restoration techniques and commands described in the Barman manual are applicable to AlloyDB Omni due to its compatibility with PostgreSQL.\u003c/p\u003e\n"],["\u003cp\u003eRestoration to a specific backup or a specific point-in-time is covered, and both methods require running the \u003ccode\u003ebarman recover\u003c/code\u003e command with the applicable options.\u003c/p\u003e\n"],["\u003cp\u003eThe target database server must be running the same major version of AlloyDB Omni as the source, and SSH connectivity must be established between the Barman server and the target server.\u003c/p\u003e\n"],["\u003cp\u003eThe provided instructions on this page are exclusive to single-server AlloyDB Omni deployments, not Kubernetes-based installations.\u003c/p\u003e\n"]]],[],null,["# Restore an AlloyDB Omni cluster using Barman\n\nSelect a documentation version: 15.5.2keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/clone-omni-barman)\n- [16.8.0](/alloydb/omni/16.8.0/docs/clone-omni-barman)\n- [16.3.0](/alloydb/omni/16.3.0/docs/clone-omni-barman)\n- [15.12.0](/alloydb/omni/15.12.0/docs/clone-omni-barman)\n- [15.7.1](/alloydb/omni/15.7.1/docs/clone-omni-barman)\n- [15.7.0](/alloydb/omni/15.7.0/docs/clone-omni-barman)\n- [15.5.5](/alloydb/omni/15.5.5/docs/clone-omni-barman)\n- [15.5.4](/alloydb/omni/15.5.4/docs/clone-omni-barman)\n- [15.5.2](/alloydb/omni/15.5.2/docs/clone-omni-barman)\n\n\u003cbr /\u003e\n\nThis page shows you how to restore an AlloyDB Omni cluster using a backup created with [Barman](https://pgbarman.org/), an open-source database backup server.\n\n\u003cbr /\u003e\n\nBecause AlloyDB Omni is compatible with PostgreSQL,\nthe data-restoration commands and techniques described by [the Barman manual](https://docs.pgbarman.org/release/latest/)\napply to AlloyDB Omni as well. This page demonstrates a selection\nof common recovery tasks, with examples of relevant commands.\n\nFor more information about configuring Barman to work with AlloyDB Omni, see\n[Set up Barman for AlloyDB Omni](/alloydb/omni/15.5.2/docs/install-configure-barman).\n\n\n| The information on this page applies only to AlloyDB Omni for containers. It does not apply to AlloyDB Omni for Kubernetes.\n\n\u003cbr /\u003e\n\nBefore you begin\n----------------\n\nBefore restoring your AlloyDB Omni data, you need\nthe following:\n\n- A target database server, running the same major version of AlloyDB Omni as the source database server. For more information about installing AlloyDB Omni, see [Install AlloyDB Omni](/alloydb/omni/15.5.2/docs/install).\n\n The target server can be the same machine as the source server.\n- The `rsync` utility, installed on the target server.\n\n- A Barman backup server, with at least one valid Barman backup of the source AlloyDB Omni database on it.\n\n- SSH connectivity between the Barman backup server and the target server.\n\n- SSH keys set up to allow the `barman` user on the Barman server to authenticate\n with the target server as its `postgres` user without a password.\n\n- Enough free disk space on the target server to hold the restored database.\n\nRecover using a specific backup\n-------------------------------\n\n| **Caution:** This operation overwrites any data stored in the target data directory.\n\n1. On the target server, stop AlloyDB Omni.\n\n docker stop \u003cvar translate=\"no\"\u003eOMNI_CONTAINER_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eOMNI_CONTAINER_NAME\u003c/var\u003e with the name that you assigned to the AlloyDB Omni container when you installed it.\n2. On the Barman server, choose a backup to restore from. To see available backups, run [the `barman list-backups` command](https://docs.pgbarman.org/release/latest/#list-backups).\n To see details about a particular backup, run [the `barman show-backup` command](https://docs.pgbarman.org/release/latest/#show-backup).\n\n3. To recover the chosen backup into the target AlloyDB Omni server,\n run [the `barman recover` command](https://docs.pgbarman.org/release/latest/#recover).\n\n When running the command, include the following:\n - Use [the remote recovery option](https://docs.pgbarman.org/release/latest/#remote-recovery).\n - Specify the target server's data directory as the destination directory.\n\n The following command demonstrates an example use of `barman recover` with AlloyDB Omni: \n\n barman recover --remote-ssh-command \"ssh postgres@\u003cvar translate=\"no\"\u003eTARGET_IP\u003c/var\u003e\" \u003cvar translate=\"no\"\u003eTARGET_LABEL\u003c/var\u003e \u003cvar translate=\"no\"\u003eBACKUP_ID\u003c/var\u003e \u003cvar translate=\"no\"\u003eDATA_PATH\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eTARGET_IP\u003c/var\u003e: the IP address of the target server.\n\n - \u003cvar translate=\"no\"\u003eTARGET_LABEL\u003c/var\u003e: the label that you assigned to the server in Barman's configuration file.\n\n - \u003cvar translate=\"no\"\u003eBACKUP_ID\u003c/var\u003e: the ID of the backup to restore from, identified in a previous step---for example, `20230810T210200`.\n\n - \u003cvar translate=\"no\"\u003eDATA_PATH\u003c/var\u003e: the path to the `data` subdirectory of the target server's data directory---for example, `/home/your-username/alloydb-data/data`.\n\n4. On the AlloyDB Omni target database server, start the\n service:\n\n docker start \u003cvar translate=\"no\"\u003eOMNI_CONTAINER_NAME\u003c/var\u003e\n\nAfter the service restarts, connect to your AlloyDB Omni server.\nYou should see your restored databases and data.\n\nRecover to a specific point in time\n-----------------------------------\n\nTo perform a point-in-time recovery, follow the same steps listed in the previous section, with one\nmodification. When you run the `barman recover` command, you must also specify one of the Barman [point-in-time recovery options](https://docs.pgbarman.org/release/latest/#point-in-time-recovery).\n| **Caution:** This operation overwrites any data stored in the target data directory.\n\nThe following command demonstrates an example use of `barman recover` with AlloyDB Omni with\na point-in-time recovery option: \n\n barman recover --remote-ssh-command \"ssh postgres@\u003cvar translate=\"no\"\u003eTARGET_IP\u003c/var\u003e\" \u003cvar translate=\"no\"\u003eTARGET_LABEL\u003c/var\u003e \u003cvar translate=\"no\"\u003eBACKUP_ID\u003c/var\u003e --target-time=\"\u003cvar translate=\"no\"\u003eRESTORE_TIMESTAMP\u003c/var\u003e\" \u003cvar translate=\"no\"\u003eDATA_PATH\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eTARGET_IP\u003c/var\u003e: the IP address of the target server.\n\n- \u003cvar translate=\"no\"\u003eTARGET_LABEL\u003c/var\u003e: the label that you assigned to the server in Barman's configuration file.\n\n- \u003cvar translate=\"no\"\u003eBACKUP_ID\u003c/var\u003e: the ID of the backup to restore from, identified in a previous step---for example, `20230810T210200`.\n\n- \u003cvar translate=\"no\"\u003eTARGET_TIMESTAMP\u003c/var\u003e: the time to restore to, in any [PostgreSQL `timestamp` format](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-INPUT-TIME-STAMPS) that specifies both a date and a time---for example, `2024-02-06 00:00:00`.\n\n- \u003cvar translate=\"no\"\u003eDATA_PATH\u003c/var\u003e: the path to the `data` subdirectory of the target server's data directory---for example, `/home/your-username/alloydb-data/data`."]]