[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThis page outlines how to restore an AlloyDB Omni cluster using backups created with Barman, an open-source database backup server, leveraging AlloyDB Omni's compatibility with PostgreSQL.\u003c/p\u003e\n"],["\u003cp\u003eThe restoration process involves using the \u003ccode\u003ebarman recover\u003c/code\u003e command on the Barman server, which supports remote recovery and requires specifying the target server's data directory as the destination.\u003c/p\u003e\n"],["\u003cp\u003eBefore beginning the restore, users must have a target server with the same major version of AlloyDB Omni, \u003ccode\u003ersync\u003c/code\u003e utility, a valid Barman backup, SSH connectivity, proper user authentication, and sufficient disk space.\u003c/p\u003e\n"],["\u003cp\u003eThe procedure detailed on the page can either restore from a specific backup ID or perform a point-in-time recovery by including a target timestamp in the \u003ccode\u003ebarman recover\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThese instructions apply solely to single-server deployments of AlloyDB Omni, not to those based on Kubernetes, and any data stored in the target directory will be overwritten.\u003c/p\u003e\n"]]],[],null,["# Restore an AlloyDB Omni cluster using Barman\n\nSelect a documentation version: 15.7.0keyboard_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.7.0/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.7.0/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`."]]