Backing up and restoring Hyperledger Fabric peers and orderers

A Fabric backup covers far more than the ledger. This page explains what each node and CA must preserve, how to take consistent orderer backups, and how to test restores before you need them.

On this page

Why a Hyperledger Fabric backup is more than a copy of the ledger

A working Hyperledger Fabric restore needs the ledgers, MSPs, node configuration, state databases and certificate authority data captured together, as one consistent set. Copying the ledger directory of a peer or orderer recovers blocks, but it does not recover the identities those nodes use to sign and authenticate, the channel and node configuration that tells them how to join and talk to the network, or the CouchDB and CA databases that hold state and enrollment records. Operators planning recovery from disk loss, corruption or a failed upgrade should treat the full set as the unit of backup and list every item that a rebuilt node would need before it can rejoin its channels.

The Fabric upgrade guide starts its four-step process with backing up the ledger and MSPs before any binary is replaced, and that ordering is a signal about where teams usually get hurt. Back up before each upgrade, before rebuilding any peer or orderer, and as a standing recovery capability that is tested on a schedule rather than only when something breaks. Confirm with your Fabric version and deployment method which files, volumes and databases hold each component, since the layout differs between Docker, Kubernetes and bare-metal installs. Ask your team to name an owner for each item and to record where it is stored, how it is encrypted and how long it is retained.

Backups also need a consistency point. Orderers and peers write continuously, so a set of files copied at different moments may not describe the same ledger height or the same channel configuration. Decide in advance how you will quiesce or sequence the copy for each node type, and plan a restore rehearsal in a separate environment to confirm that the recovered node starts, catches up and passes the health checks in the operations service. A backup that has never been restored is an assumption, not a recovery plan.

What a complete Fabric backup must contain

A Fabric backup is a set of linked artifacts, not one ledger copy. Each component below is needed to rebuild a peer, orderer or CA with the same identity, configuration and ledger state it had at the backup point. Confirm each item against your own deployment before you rely on a backup plan.

Peer ledger files

The peer ledger holds block files and the transaction history for each channel, and it is the record every other peer is checked against. Without it, a restored peer must replay history from other peers, which can be slow on a large channel. Back up the ledger directory for each channel at a consistent point, and confirm the peer's configured ledger path so nothing is missed. Also check whether you use ledger snapshots, since they are a separate join path, not a substitute for a backup.

Fabric upgrade guide

Peer state database

The state database holds the current value of every key, either as LevelDB files inside the peer or as CouchDB databases. Its contents can be rebuilt from the block files, but rebuilding a large state database takes time that delays peer recovery. If you use CouchDB, back up its databases and index definitions alongside the peer, and make sure the two are taken from the same point in time. Confirm which backend each peer uses before you write the restore runbook.

Peer and orderer MSP material

MSP directories hold each node's signing certificate, private key, and the CA and admin certificates that define its organization. A restored node without its original MSP cannot sign or be recognized by channel members, and the key cannot be replaced without a channel configuration update. Back up MSP material with strict access controls, and confirm where keys live if you protect them in an HSM, since PKCS#11 keys are not held as files.

Orderer ledger and channel configuration

The orderer keeps the block ledger for each channel, and the latest config block defines consenters, organizations and policies. Restoring an orderer from an older copy can roll its view of the channel back, so back up every channel's ledger and config at one consistent point. For Raft, confirm that the cluster state on each consenter is captured together, since nodes that disagree on the last block will fail to rejoin cleanly. Check the ordering service documentation before choosing a restore order.

Ordering service docs

Node configuration and TLS material

Core configuration files, environment settings, operations service settings and TLS certificates and keys define how each node starts and how it talks to others. A backup of the ledger without these files forces an operator to rebuild endpoints, ports and TLS identities by hand, which often produces mismatches that block connections. Store configuration under version control with secrets referenced, and keep TLS keys in a protected backup with the same retention rules as MSP material.

Fabric CA databases and certificates

Each Fabric CA stores its identities, issued certificates and revocation state in a SQLite, PostgreSQL or MySQL database, and holds its own CA certificate and key. Losing the database means losing the record of who was enrolled and what was revoked, and losing the CA key means existing identities can no longer be trusted or renewed under the same root. Back up the CA database and the CA key material together, and confirm which backend your CA uses, since restore steps differ for each.

Fabric CA user guide

Choosing a backup method for peers, orderers and CA databases

On Kubernetes, peers, orderers and CAs usually keep their ledgers, MSP material and configuration on persistent volumes, so the backup question becomes which layer you copy from. A volume-level snapshot is fast and captures the whole volume, but it only gives a consistent Fabric state if the process writing to that volume is quiesced or the snapshot is taken at a point where the component can recover cleanly. Many teams pair volume snapshots with logical backups of the database that sits beside the peer, such as a CouchDB export, so each piece can be restored independently. Options to weigh include:

  • Volume snapshots per component: Capture the peer or orderer data volume and its MSP and TLS secrets on a schedule, then confirm the storage class supports snapshots and that they are included in your cluster backup tooling.
  • Logical dumps for database-backed state: Run native dumps for CouchDB or the CA's PostgreSQL or MySQL database, stored outside the cluster, so a restore does not depend on a single volume.
  • Secret and configuration export: Export Kubernetes Secrets and ConfigMaps holding MSP and TLS material through your approved secret-handling process, not as plain manifests in a shared repository.
  • Restore rehearsal in a separate namespace: Restore into an isolated namespace and confirm the peer starts and rejoins its channels.

Confirm with your Kubernetes storage vendor how snapshots behave for your volume type and whether they are crash-consistent or application-consistent.

How backup points fit together across peers, orderers and CAs

The diagram starts with the peer, orderer and CA hosts inside the cluster, each holding its own ledger, state database, MSP material or CA database. A coordinated window captures a backup point on every node, and each point is copied to a backup store outside the cluster. The store is separate from snapshot storage, and a restore test environment pulls from it. Check that every node's point falls in the same window and that a restore test succeeds before you rely on the set.

Per-node backup points taken in one window, copied to a store separate from snapshots.

Taking a consistent backup point on an orderer

This sequence captures an orderer's ledger and MSP material at a known block height, with confirmed consenter health and a verified restore point. Each node is handled one at a time so the Raft cluster keeps its quorum throughout.

  1. Confirm consenter health and channel config

    The orderer operator checks that every consenter in the cluster is reachable and that the cluster has a leader, before touching any node. Pull the current config block for each system and application channel the orderer serves, using the peer or osnadmin tooling your team already uses, and archive it with the backup set. Done means every consenter responds, a leader is elected, and the config block files are saved with their block numbers recorded. If any consenter is unhealthy, stop here, because backing up a node in a degraded cluster removes margin you may need during recovery.

  2. Record block heights across consenters

    Query the block height on each consenter for every channel it serves and write the values into the backup record. Heights should match or differ only by the few blocks that replication has not yet delivered to a lagging node. A consenter that is behind the others is a poor choice to back up, so select a node whose height matches the leader and note the chosen height as the consistent point for this backup. Done means you have a height table for all consenters and a named target node.

  3. Stop the selected consenter in a controlled order

    Confirm that stopping the chosen node still leaves a Raft majority running, which for a five node cluster means at least four nodes must remain up while one is stopped. Stop the orderer process cleanly so in-flight writes finish and files are closed, and record the time and the surviving node list. Do not stop a second consenter until the first has rejoined and caught up. Done means the process has exited, the remaining nodes report a leader, and the cluster still accepts transactions.

  4. Capture ledger and MSP material

    With the node stopped, copy the orderer ledger directory, the MSP directory, the TLS key and certificate files, and the orderer configuration files to the backup target. Record checksums for each archived file so the set can be verified later. Keep the copy on storage separate from the node, and treat the MSP and TLS private keys as secrets with restricted access. Done means every item is copied, checksums are written to a manifest, and the manifest is stored with the backup.

  5. Restart and confirm the node rejoins

    Start the stopped consenter and watch its logs and operations endpoint until it reports a leader and begins catching up. Compare its block height with the rest of the cluster over time, and do not start the next backup until the height matches the leader. Confirm the node's health check reports healthy. Done means the node's height equals the cluster height for every channel, and the cluster has returned to full membership.

  6. Verify the archived backup set

    Recompute the checksums of the archived files and compare them with the manifest. Confirm the manifest records the target height, the config block numbers, and the node identity. Where your environment allows, restore the set into an isolated test location and check that the orderer starts and reports the recorded height. Done means the checksums match, the manifest is complete, and the test restore reaches the recorded height or you have a documented reason it did not.

Why snapshots do not replace backups for Fabric

A volume snapshot is not a Fabric backup unless the components inside it are captured at the same point. A peer writes to its block store, its state database and its private data store as it commits each block, and an orderer writes its consenter log and channel data on its own schedule. A snapshot taken without coordination can capture a ledger mid-write, or a CouchDB state database that is out of step with the block store. Restoring that copy may start a peer that fails to reconcile, or that needs state rebuilt from blocks. Before relying on snapshots, confirm with your storage vendor whether they are crash-consistent or application-consistent, and whether they cover every volume that holds peer, orderer, MSP, CA and CouchDB data together.

Location matters as much as timing. A snapshot stored in the same cluster, account, storage pool or region as the node it protects shares that node's failure domain. A deleted namespace, a compromised cloud account, a ransomware event or a storage array fault can remove the snapshot along with the live data. Keep at least one copy of the backup set outside that domain, with its own access controls and retention rules. Retention should match your recovery and regulatory obligations, and you should be able to say how far back a restore can go and which backup points remain for each channel and organization.

A backup you have not restored is an assumption. Schedule restore tests that rebuild a peer and an orderer into an isolated environment, then confirm that the peer rejoins its channels, that MSPs and TLS material load, and that the ledger height matches the expected block. Fabric's ledger snapshot feature is a different tool. It lets a new peer join a channel from a snapshot of an existing peer's ledger, avoiding a replay of history. It is not designed to restore a lost organization's full recovery state, and it does not replace the backup set described in the upgrade guidance, which asks operators to back up the ledger and MSPs before changes. Test both paths separately.

Backup options and when each fits

This table compares four backup approaches for Fabric peers, orderers and their supporting databases, showing what each captures, when it fits and its main trade-off. Read each row as one layer of a backup set, since no single option covers ledgers, MSPs, CouchDB state and CA data together. The main takeaway is that a volume snapshot alone rarely gives a restorable, consistent copy of every component.

OptionWhat it capturesWhen it fitsMain trade-off
Cold file copy of a stopped nodePeer or orderer data directories, including the ledger, channel configuration and local MSP files, copied while the node is downSmall or maintenance-window restores where a short outage is acceptable and the node is cleanly stopped firstRequires downtime, and the copy is only as complete as the directories you list; confirm the full file set with your Fabric version
Volume snapshot plus separate logical backup of CouchDBBlock-level image of the peer volume, paired with a CouchDB-level export of the state database taken as a separate stepPeers on storage platforms with snapshot support, where state database and ledger must be restored togetherSnapshots are point-in-time per volume, so the two pieces can drift unless coordinated; confirm consistency behavior with your storage and CouchDB setup
Native database backup for the CA databaseContents of the SQLite, PostgreSQL or MySQL database used by Fabric CA, using that database's own backup toolingAny CA deployment using an external database, including clustered CAs sharing one database behind a load balancerRestores the registry and certificate records, not the issued keys held by identities; confirm which CA files also need separate backup
Off-cluster object storage copy with retentionEncrypted copies of the backup sets from the options above, stored outside the cluster with versioned retention periodsAny production network, as the off-site layer that survives loss of the cluster or its storageAdds transfer, encryption and key management work, and retention periods must match your own policy and any regulator requirement

Setting up a repeatable Fabric backup and restore routine

This sequence turns backup from a one-off task into a routine that captures every node's state at consistent points, stores verified copies outside the cluster, and proves on a schedule that a restored peer can rejoin the network. The output is a tested runbook with evidence from each restore exercise.

  1. Inventory every node and its state stores

    Before writing any script, list every peer, orderer, Fabric CA server and database in the network, along with the directories or volumes that hold its ledger, MSP material, TLS keys, configuration files and any CouchDB or CA database. Record which organization operates each node and who holds the keys. The step is done when the inventory matches the running topology and each organization has signed off on its own rows. Confirm with each member organization whether any MSP or TLS material sits on an HSM, since PKCS#11 keys are not captured by copying files.

  2. Set backup frequency around activity and upgrades

    Tie backup frequency to how often channels change, not to a calendar alone. Channel configuration updates, chaincode definition changes, new organizations and certificate reissues should each trigger a capture. Upgrade windows need a backup before the work starts, because the Fabric upgrade guide places ledger and MSP backups as the first step before orderer and peer binaries are changed. Write the trigger rules into the runbook and assign an owner for each node. The output is a schedule document that names the events that force an unscheduled backup.

  3. Script per-node capture with checksums

    Write one capture script per node type so each node is backed up with the same procedure and naming scheme. Each run should stop or quiesce the node where the storage engine requires it, copy the ledger, MSP, TLS and configuration paths, and dump the CouchDB or CA database using that database's own tooling rather than a raw file copy of a live store. Generate a SHA-256 checksum file for every artifact and record the node name, Fabric version, channel list and timestamp in a manifest. Done means a capture run produces a complete artifact set and a manifest that a second person can read.

  4. Store copies outside the cluster under access controls

    Move each artifact set to storage that is separate from the cluster it protects, such as a backup account or site that the cluster's administrators cannot delete from unilaterally. Restrict read and write rights to named operators, encrypt the archives at rest, and log every access. MSP and TLS private keys are sensitive enough that the organization should decide, in writing, who may retrieve them and under which approval. Confirm the retention period with your compliance owner, since the routine should not invent one. Done means a test retrieval succeeds for an authorized operator and fails for everyone else.

  5. Verify stored copies by hash comparison

    Before any restore is attempted, recompute the checksums on the stored copies and compare them with the values in the manifest written at capture time. Any mismatch marks the set as unusable, and the capture is repeated rather than patched. Also check that the manifest lists every expected artifact for that node type, so a missing CouchDB dump is caught here and not during an incident. The output is a verification log per backup set with a pass or fail result and the operator's name.

  6. Restore into an isolated environment on a schedule

    On a fixed schedule that the organization chooses, rebuild a peer and an orderer from the stored artifacts in an environment that cannot reach production channels or gossip with live members. Use separate hosts or a segregated network, restore the MSP and TLS material, and start the nodes with their original configuration after reviewing it for any production-only endpoints. The step is done when both nodes start, report healthy through the operations service, and show the same ledger height as recorded in the manifest. Document any gap between captured and restored state.

  7. Test a join of the restored peer

    Using the isolated environment, have the restored peer join a test channel and then compare its state with a reference peer. Check that the block height matches, that a read of known keys returns the same values, and that the peer can endorse a test transaction for a chaincode already installed on it. If private data collections are in use, confirm the peer holds the expected collection data for the organization it represents. The output is a join report that lists each check, its result and the Fabric version tested. A failed check opens a corrective action before the routine is marked as passing.

  8. Record restore time and verification results

    After each restore exercise, record how long each step took, which artifacts were used, which checks passed or failed, and what the operator had to fix by hand. Compare the results with the previous exercise and with the recovery expectations the organization has agreed with its members. Feed any gaps back into the inventory, the capture scripts and the schedule. Done means the runbook has a dated revision with the exercise results attached, and the next restore date is assigned to a named owner.

Protecting backup data and keys

A Fabric backup is a copy of identity and key material as well as ledger data, so it carries the same risk as the live node. The cards below cover the controls that keep backup stores, restore rights and CA data from becoming the weakest point in the network.

Treat MSP and TLS keys as live secrets

A peer or orderer backup usually includes the MSP directory and TLS key material, which let whoever holds the copy act as that node. Store these with the same access limits and rotation rules as the running node's keys. Ask your team to list exactly which key files each backup job collects, so no copy of a private key is stored without a named owner.

Fabric upgrade guide

Confirm the HSM recovery path

When peer and orderer MSP keys sit in an HSM through PKCS#11, a file copy of the key directory does not contain the signing keys. Before go-live, confirm how a replacement node regains signing capability, including HSM backup, partition access and the custom image that enables PKCS#11. TLS keys remain file-based and must be backed up separately.

Fabric HSM docs

Encrypt backup stores

Backup archives hold ledger data, identity material and configuration, so the storage location needs encryption at rest and in transit. Keep encryption keys in a system separate from the backup store. Ask your storage team to confirm who can read, replace or delete backup objects, since a tampered backup can produce a restored node that looks valid.

Restrict restore rights

A restore can reintroduce an old identity or a stale channel configuration into a live network, so it is a privileged operation. Limit restore permissions to a small group, require a second approver for production restores, and test restores in an isolated environment before any production action. Document who may start a restore and under which incident conditions.

Log every backup and restore

Record the time, operator, node, backup point, source location and outcome of each backup and restore job. These records show auditors and incident responders which keys and ledger heights existed at a given time. Send them to a log store the node operators cannot edit, and review failed jobs as security events.

Align CA backups with revocation

If the Fabric CA database is restored from an older copy, certificates revoked after that copy was taken may become valid again, and certificate revocation lists may fall out of step with the network. Schedule CA database backups with a known revocation state, compare restored revocations with the current list, and confirm the CA's database backend (SQLite, PostgreSQL or MySQL) supports your backup method.

Fabric CA user guide

Questions teams ask before backing up Fabric networks

How much does a Fabric backup program cost and what drives it?

Cost depends on how much you need to protect and how often you need to prove it works. The main drivers are the number of peers, orderers and CA servers, the size and growth rate of ledgers and state databases, the storage and retention period you choose, how often restores are tested, and whether signing keys sit in an HSM that needs its own handling. Setup is usually a one-time cost, while retention storage, scheduled backup jobs, monitoring and periodic restore tests recur. Ask any provider for a quote that lists each node type, the backup targets, retention periods, the number of restore tests per year and who performs each step. The Fabric upgrade guide also treats a ledger and MSP backup as a required step before each binary upgrade, so upgrade frequency adds to the recurring effort.

How long does it take to set up Fabric backups?

Setup time depends on the size of the network and how much of it is already documented. Teams that already know where each peer keeps its ledger, MSP folder, CouchDB data and CA database usually move faster than teams that must first map every component. Other drivers include whether backups must be scripted for Kubernetes volumes or host paths, whether the CA runs on SQLite, PostgreSQL or MySQL, how many orderer consenters must be coordinated, and how many change windows are available for test backups. Your schedule should also allow at least one full restore test in a non-production environment before the first production backup is trusted. Ask for a plan that lists the milestones, the environments used for testing and the decisions that must be made by your team before work starts.

What does the work need from our team?

The work needs read and write access to the peer, orderer and CA hosts or containers, and to the storage where backups will land. CA administrator rights are required to export the CA database and confirm the CA configuration, and the team needs the MSP and TLS material locations for each organization. Your team should plan change windows for consistent backups of orderers, since the backup point must be coordinated across the consenter set. Storage access includes the backup target, retention policy approval and any encryption key management your security policy requires. Expect your team to review backup contents, approve restore runbooks and confirm where HSM-protected keys are held. Put these access requirements in the written scope so each dependency has an owner.

Can our internal team run Fabric backups on its own?

An internal team can run backups alone if it already operates Fabric peers, orderers and CAs and has someone who understands channel configuration, MSP layout and the CA database. The areas most often missed are the MSP folders, the CouchDB state database, the CA database and the consistent backup point across orderers, so a checklist and a restore test are the first things to confirm. A team new to Fabric usually needs outside help for the design of the backup scope and the first restore exercise, then can operate the routine jobs internally. DeployOpen plans, implements, documents and supports self-hosted open-source platforms in your infrastructure, so backup design, scripting, restore runbooks and periodic testing can be scoped as a fixed engagement or a retainer.

Is a volume snapshot enough to back up a Fabric network?

A volume snapshot is not enough on its own. A snapshot captures the bytes on disk at one moment, but it does not guarantee that the ledger, state database, MSP folders, CA database and configuration were captured at a consistent point across nodes. CouchDB and the CA database may be on different volumes or in different services, and a snapshot of one may not match the others. Snapshots also replicate any corruption or unwanted state into the copy, and they rarely include the key material and configuration you need to rebuild a node in a new location. Snapshots can be part of a plan, but treat them as one tool next to exported, documented backups that you have restored successfully in a test environment.

How often should we test Fabric restores?

Test restores on a fixed schedule and after any change that affects what is backed up, such as a Fabric version upgrade, a CA database change, a new channel or a storage migration. The Fabric upgrade guide already requires a ledger and MSP backup before binaries change, so the minimum practice is a restore check that proves the backup can be used before that upgrade proceeds. Define the restore test in writing: which node is rebuilt, which environment it runs in, how the peer rejoins its channel, and what counts as success. Frequency should follow your risk appetite and your regulator or auditor expectations, which you should confirm with your compliance team. Keep the test results as evidence, since they show the backup process works in practice.

Which parts of a Fabric node must the backup include beyond the ledger?

A complete backup covers more than the ledger. For each peer and orderer, include the MSP folders with signing and TLS material, the node configuration files, the CouchDB state database if used, and the private data collection data held by peers. For each CA, include the CA database, the CA configuration and the root or intermediate key material, protected according to your key policy. Record the channel configuration blocks and the chaincode definitions used on each channel so they can be re-applied if needed. The Fabric HSM documentation states that TLS keys must stay file-based even when MSP keys are in an HSM, so the backup plan should treat those TLS files separately. Confirm the exact file list for your Fabric version with the Fabric docs before finalizing the scope.

How DeployOpen scopes and delivers Fabric backup and restore

DeployOpen plans, implements and documents backup and restore for Hyperledger Fabric peers and orderers inside the infrastructure you control. The work starts from a written scope that names every component to be protected, then builds, tests and hands over the backup and restore procedures your own operators will run.

How we scope

  • Inventory each peer, orderer, CA and CouchDB instance, with its volumes, keys and configuration files.
  • Agree in writing which MSPs, TLS material, channel configuration and CA databases the backup must cover.
  • Confirm recovery goals with your team, including who approves a restore and how far back data may be rolled.

How we build

  • Design a consistent backup point for orderers and peers, and define the order in which nodes are quiesced or captured.
  • Script backup jobs for ledgers, key material and CouchDB data, with storage location and access controls set per your policy.
  • Test restores on a separate environment, rebuilding a peer and an orderer node and checking channel height and state.

How we hand over

  • Deliver runbooks for backup, restore, node replacement and recovery after an expired or lost certificate.
  • Document retention, encryption and key custody decisions so compliance and security reviewers can trace them.
  • Walk your operators through a restore drill and record the results in the handover package.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer, including re-running restore tests after Fabric upgrades.
  • Confirm with DeployOpen which support hours, response paths and retest cycles the retainer covers before signing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.