Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Barman centralizes PostgreSQL physical backups, write-ahead-log (WAL) archiving, point-in-time recovery and disaster-recovery operations. A reliable deployment uses a separate Barman host, a normal database connection, a replication-capable streaming connection when required, correctly configured WAL delivery, and regular restore drills. This guide shows how to configure those pieces, run and verify backups, recover to a directory or timestamp, and move a same-major-version PostgreSQL database to another server.

What Barman is and when it fits

Barman (Backup and Recovery Manager) is an open-source Python administration tool for PostgreSQL disaster recovery. It manages full hot physical backups, WAL archiving and streaming, retention policies, compression, incremental backup and recovery, parallel operations, diagnostics, and point-in-time recovery.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Its physical-backup model captures a PostgreSQL data directory and the WAL needed to make that copy consistent and replayable. That makes Barman a strong fit when you need a central backup host, repeatable recovery procedures, continuous WAL protection, and recovery to a selected time. It is not a universal answer for every migration: moving between different PostgreSQL major versions requires a separate logical or dump-based design.

PostgreSQL’s own guidance is unambiguous: databases that contain valuable data should be backed up regularly. A backup job that has never been restored, or whose required WAL has expired, is not a dependable recovery plan.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

How Barman’s architecture works

Place Barman on a dedicated host with network access to the PostgreSQL server. The Barman host stores base backups and WAL, and runs the client utilities needed to take streaming backups and perform recovery. Keeping this host separate limits the chance that a failure of the database machine also destroys the backup catalogue.

  • conninfo: the PostgreSQL connection Barman uses for normal operations and server management.
  • streaming_conninfo: a separate connection used when Barman streams WAL or takes streaming backups.
  • Replication role: the streaming connection should use a dedicated role with replication capability rather than an everyday application account.
  • pg_hba.conf: must permit the Barman host and the specific roles to connect.
  • wal_level = 'replica': required for coherent physical backups. PostgreSQL releases can have different settings and requirements, so check the manual for the exact release you operate.

WAL can reach Barman through PostgreSQL’s archive_command, through a streaming archiver, or through both. Streaming WAL continuously can reduce the recovery point objective (RPO) compared with relying only on periodic archive delivery, because less time passes between WAL generation and its arrival at the backup host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prerequisites to complete before the first backup

  • A dedicated Barman host with enough storage for the selected base-backup and WAL retention window.
  • Network routing and firewall rules that allow the Barman host to reach PostgreSQL.
  • A normal PostgreSQL login for conninfo.
  • A dedicated replication-capable login and streaming_conninfo if you will stream WAL or use streaming backups.
  • pg_hba.conf entries that permit those connections from the Barman host.
  • wal_level = 'replica' on the PostgreSQL server.
  • A compatible PostgreSQL client installation on the Barman host, including pg_basebackup for streaming backups.
  • SSH key authentication and least-privilege access if a remote recovery will fetch WAL with barman-wal-restore.
  • A documented RPO (maximum acceptable data loss) and recovery time objective (RTO), which determine WAL and base-backup retention.

Configure a PostgreSQL server in Barman

Barman server definitions use INI syntax. A supported-open-source example stores the server file under /etc/barman.d:

[pg]
description = "Example of PostgreSQL Database (Streaming-Only)"
conninfo = host=pg user=barman dbname=pagila
streaming_conninfo = host=pg user=streaming_barman dbname=pagila
backup_method = postgres
streaming_archiver = on
slot_name = barman

Replace the hostname, database, role names and slot name with values from your environment. The example’s backup_method = postgres tells Barman to use PostgreSQL’s streaming-backup mechanism. streaming_archiver = on enables WAL streaming, and slot_name identifies the replication slot used to retain WAL until Barman receives it.

Do not copy credentials, hostnames or a slot name unchanged from an example. Create roles with only the permissions required for backup and streaming, and store credentials and SSH keys so that only the Barman service account can read them.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Choose and configure WAL delivery

Archive-command delivery

PostgreSQL can invoke an archive_command whenever a WAL segment is ready to archive. This method is straightforward and can coexist with streaming. Its RPO is governed by how quickly PostgreSQL archives completed segments and how quickly Barman receives them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Streaming archiver

A streaming archiver maintains a continuous replication connection from Barman to PostgreSQL. It is useful when you want WAL to arrive without waiting for a segment to be completed and archived. Configure streaming_conninfo, the replication-capable role, streaming_archiver = on, and a suitable replication slot.

Using both paths

Using archive delivery and streaming together can provide operational resilience: one path may continue if the other is temporarily unavailable. Whichever design you choose, monitor the Barman catalogue and resolve delivery failures before the oldest required WAL falls outside your recovery window.

Make sure Barman is using the right PostgreSQL client

Streaming backups use PostgreSQL’s pg_basebackup utility, so a compatible client binary must be installed on the Barman host. The Barman manual recommends the postgres backup method for streaming backups. If several PostgreSQL client versions are installed, use Barman’s path_prefix setting to select the intended binaries instead of relying on whichever executable happens to appear first in the service account’s PATH.

Client compatibility is a deployment prerequisite, not a cosmetic preference. Confirm the selected binary before taking a production backup and repeat the check after operating-system or PostgreSQL-client upgrades.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Run preflight checks and take a base backup

  1. Run the diagnostic check: execute barman check SERVER for the configured server. Run it before production use and after any configuration, authentication, client-binary or WAL-transport change.
  2. Fix every reported issue: check connectivity, permissions, replication access, WAL settings, storage paths, client utilities and slot status. Do not treat a warning that affects WAL delivery as harmless.
  3. Start a base backup: use Barman’s backup command for the server after the check passes. With backup_method = postgres, Barman invokes the compatible streaming-backup tooling.
  4. Confirm catalogue and WAL state: verify that the backup appears in Barman’s catalogue and that the WAL generated after the backup is arriving through the configured transport.
  5. Record the backup identity: retain the Barman backup ID with the operational ticket or recovery documentation; the ID is required by the recovery command.

A base backup is not recoverable merely because its files exist. Required WAL must be archived or streamed into Barman’s catalogue so PostgreSQL can replay the backup to a consistent state and, when needed, to a later recovery target.

Set retention from the recovery window

Barman includes retention-policy management, but there is no universal retention period to copy. Select the number and age of base backups and WAL segments from your business RPO and RTO, legal or regulatory requirements, and available storage. A policy that deletes WAL before the oldest retained base backup can no longer meet the recovery targets is internally inconsistent.

  • RPO: how much committed data the organisation can afford to lose. Continuous streaming can reduce the gap between the latest protected WAL and the failure time.
  • RTO: how long the service can be unavailable while you provision a target, recover the files and replay WAL.
  • Legal retention: a business or regulatory requirement may require keeping backups longer than the operational recovery window.
  • Storage protection: restrict access to the Barman repository and protect it from deletion or encryption by the same incident that affects production.

Restore a Barman backup to a PostgreSQL server

The core recovery form is:

barman recover SERVER BACKUP_ID /path/to/recover/dir
  1. Stop the destination PostgreSQL instance. Recovery writes a data directory; it is not an in-place operation against a running server.
  2. Choose an empty or dedicated target directory. Do not point the command at a live instance’s data directory. A dedicated path makes it easier to inspect the recovered files and roll back a failed attempt.
  3. Run the recovery command with the Barman server name, the selected backup ID and the destination directory.
  4. Account for relocated paths. Barman’s physical recovery model can relocate the PostgreSQL data directory and tablespaces when destination paths differ from the source.
  5. Configure WAL retrieval for the target. A local recovery can use Barman’s get-wal facility. A remote recovery can use barman-wal-restore to retrieve WAL over SSH.
  6. Start PostgreSQL only after the files and recovery settings are ready. Watch the server log while it replays WAL and confirm that recovery reaches the intended state.
  7. Validate the result. Check that the expected databases, schemas, roles, permissions and application data are present, then exercise critical application paths before returning traffic.

barman-wal-restore is designed to handle SSH connection errors and can provide compression/decompression and prefetch (“peek”) behaviour. Configure SSH keys and least-privilege access before an incident; discovering that the recovery account cannot connect during an outage defeats the procedure.

Perform point-in-time recovery (PITR)

PITR restores a base backup and replays WAL only until a selected recovery target. Use it when a logical mistake, application defect or accidental deletion occurred after a known good moment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Select a recovery target

Choose a timestamp, transaction, or named restore point from the incident plan. A timestamp is useful when the failure time is known; a transaction target is appropriate when an offending transaction has been identified; a named restore point works when the application or operator created one before a risky change.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Replay and stop at the target

Recover the chosen backup into an isolated directory, configure WAL retrieval, and start PostgreSQL so it replays WAL to the selected target. Stop or promote the recovered instance according to the recovery procedure once the target is reached.

Validate before declaring success

  • Confirm that the database starts cleanly and that recovery has stopped at the intended point.
  • Check the affected rows and related tables, not just whether the server accepts connections.
  • Run application-level checks for authentication, writes, background jobs and critical queries.
  • Record the achieved RPO and RTO from the drill or incident. The cited Barman documentation describes command mechanics, not a universal recovery-time or recovery-success statistic.

Migrate PostgreSQL to a new server with Barman

Same-major-version migration

  1. Provision the destination: install a compatible PostgreSQL release, Barman tooling and the client utilities required for recovery.
  2. Prepare storage: create the destination data-directory and tablespace mount points, accounting for any path differences from the source.
  3. Choose the cutover backup: select a Barman base backup that satisfies the migration plan and confirm that all WAL needed to reach the cutover point is available.
  4. Recover into the new data directory: run barman recover SERVER BACKUP_ID /path/to/recover/dir, using path relocation where required.
  5. Replay WAL to the cutover point: recover to the latest acceptable point or a planned timestamp, transaction or restore point.
  6. Validate the destination: start PostgreSQL, inspect logs, verify roles and permissions, compare critical data, and test application connections and writes.
  7. Cut over traffic: repoint applications only after the destination starts cleanly and validation passes. Keep the source available according to the documented rollback window.
  8. Document rollback: define how traffic returns to the source if validation fails, and identify which writes must be reconciled after a partial cutover.

Barman’s physical recovery is tied to PostgreSQL compatibility. A same-major-version relocation is therefore a natural use of the recovery workflow, including different data-directory and tablespace paths.

Different-major-version migration

A major-version change is a separate design problem, not a routine Barman restore. Physical base-backup replay depends on PostgreSQL compatibility; do not assume that a backup from one major release can be started directly on another. For a different destination major version, use a PostgreSQL-version-appropriate logical or dump-based migration plan and document its export, import, validation, downtime and rollback steps separately from the Barman restore procedure. The Barman recovery steps above remain useful for disaster recovery within a compatible version, but they do not constitute a complete cross-major-version runbook.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Operational checklist for production readiness

  1. Create least-privilege Barman and streaming roles, and verify the matching pg_hba.conf rules.
  2. Configure conninfo, streaming_conninfo when needed, backup_method, WAL archive or streaming transport, and replication slots.
  3. Run barman check SERVER and resolve every reported issue.
  4. Take a base backup and confirm both catalogue status and ongoing WAL arrival.
  5. Recover into an isolated target directory rather than testing on the live data directory.
  6. Exercise PITR with a documented timestamp, transaction or restore point.
  7. Measure and record the achieved RPO and RTO, including time spent provisioning storage and replaying WAL.
  8. Protect Barman storage, database credentials, replication slots and SSH keys from unauthorised access or deletion.
  9. Rehearse migration cutover and rollback before changing production traffic.

Common failure modes and fixes

Barman cannot connect

Check the hostname, port, database name and role in conninfo or streaming_conninfo, then inspect network rules and the matching pg_hba.conf entry. Test the normal and replication connections separately; success with one does not prove that the other is authorised.

Streaming backup cannot start

Confirm that the Barman host has a compatible pg_basebackup, that backup_method is set to postgres, and that the selected client directory is first in Barman’s path_prefix when multiple client versions exist. Verify the replication role and PostgreSQL’s wal_level.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

WAL is missing during recovery

Inspect the archive or streaming path, replication-slot health and Barman catalogue. A base backup without its required WAL cannot be considered recoverable. Do not delete older WAL until the retention policy confirms that every retained backup has sufficient coverage.

Remote WAL retrieval fails

Check SSH key permissions, the remote account’s access to the Barman repository and host-key verification. Confirm that the recovery target can invoke barman-wal-restore with the expected compression and prefetch behaviour.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recovery was attempted on a live directory

Stop PostgreSQL and restart the exercise in an empty, dedicated target directory. Never overwrite the data directory of a running instance with a physical recovery.

Migration target starts but applications fail

Compare roles, grants, tablespace paths, connection settings and application configuration. Database startup alone is not a cutover validation; test representative reads, writes and background processing before repointing traffic.

Barman compared with other PostgreSQL backup approaches

The meaningful comparison is operational rather than brand-based. Evaluate the recovery model and the controls around it:

Decision axis Barman’s documented model Question to ask about another approach
Recovery type Physical base-backup recovery with WAL replay Does it restore a whole compatible cluster, selected objects, or both?
Point-in-time recovery Supported through base backup plus WAL and a recovery target Can it stop at a timestamp, transaction or named restore point?
WAL transport archive_command, streaming archiver, or both How quickly does WAL reach protected storage, and how is lag monitored?
Retention Retention-policy management is included; the period is an organisational choice Can policy preserve the base backups and WAL required for the stated RPO and legal window?
Cross-version migration Physical recovery is for compatible PostgreSQL versions; major-version moves need another plan Does the method provide a supported logical or dump-based path between the chosen versions?
Operations Centralised catalogue, diagnostics, compression, incremental and parallel operations What monitoring, alerting and restore-test workflow does the method provide?
Proof of recoverability Requires barman check, WAL verification and isolated recovery drills When was the last complete restore tested, and what RPO/RTO did it achieve?

What a dependable Barman deployment looks like

The minimum dependable pattern is a separately hosted Barman installation, least-privilege database and replication accounts, compatible PostgreSQL client binaries, continuously monitored WAL delivery, a retention policy tied to business requirements, and a tested recovery directory. Backups should be treated as a chain: base backup, every required WAL segment, credentials, storage, recovery configuration and a validated application cutover. Breaking any link can turn an apparently successful backup job into an unusable recovery.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.