HBase doesn't ship one universal “backup” button. The proper method depends on what you need to recover from: a table deleted by mistake, a corrupted RegionServer, or the loss of the entire cluster. In most production deployments, teams combine two mechanisms. They take periodic full backups with the HBase Backup and Restore (BR) tool built into the service, and they copy the underlying HFiles for large tables or cross-cluster disaster recovery. Both approaches need a tested restore procedure, because a backup you've never restored is just a hopeful copy of bytes. The specifics below apply to Apache HBase 2.x on the standard Hadoop/HDFS stack, and each step names the check that tells you it worked.
Before You Run Anything: Establish the Baseline
A desperately common failure isn't a bad backup tool. It's a cluster whose actual state nobody confirmed. Before the first backup job, spend time settling four things.
First, confirm the platform. Run hbase version on the client and on a RegionServer, and confirm the Hadoop client version matches. The BR tool's behavior, especially around incremental backups and WAL handling, varies between HBase 1.3, 2.4, 2.5, and 2.6. Write the exact version into your runbook, not just “HBase 2.x.”
Second, record the table inventory. hbase shell and the command list gives the table list; describe '' gives column families, versions, TTL, and compression. Since the BR tool captures data, not schema automatically restored as part of the data path, schema is a separate asset. Export it with hbase shell using describe '' > table-schema.txt for every table, and keep those files with the backup metadata.
Third, size the job. Use hdfs dfs -du -s -h /hbase/data// on each table to see the stored bytes. This determines how long a snapshot-based export will run and how much destination space you need. A full export compresses on the way out, so the destination target is usually smaller than raw HDFS usage, but plan at least the raw size plus headroom.
Fourth, choose a destination outside the cluster you're protecting. HDFS is replicated, generally threefold by default, but replication protects against a disk or DataNode failure within one cluster. It does not protect against an hbase shell drop command, a bad application migration, or a cluster-wide configuration disaster. A backup that lands in the same HDFS namespace as the source is a convenience copy, not a backup.
Decide Which Backup Strategy Fits Your Recovery Objectives
There are three main mechanisms in HBase 2.x, and they serve different purposes.
The HBase Backup and Restore tool (hbase backup) exports table snapshots and, in newer versions, incremental images to a destination filesystem such as a separate HDFS cluster, S3A, or a mounted NFS volume. It's the closest thing HBase has to a first-class logical backup. It records its own manifest of what was exported, which makes enumeration reliable.
HBase snapshots alone (snapshot 'table', 'snapname') are metadata-plus-reference operations. They are nearly instant and cost no data copy, because they freeze the current set of HFiles. But a snapshot is inside the same cluster. If you lose the cluster, you lose the snapshots with it. Snapshots are excellent for fast rollback of a bad write or an accidental delete, and they're the internal building block of export-based backups. They aren't a disaster-recovery strategy by themselves.
Raw HFile copy, via distcp of /hbase/data or per-table directories, is a byte-level copy of the store files. It's the fastest way to move very large tables to a second cluster and the natural approach for full-cluster replication to a warm standby. The catch: files must be consistent, table schemas must exist on the destination, and a hand-built copy requires care to match the snapshot view rather than a moving target.
The practical pattern most teams converge on is straightforward: frequent snapshots for short-term rollback, scheduled BR full exports to an off-cluster destination for restore of individual tables, and a distcp-based process or HBase replication for large-scale cross-cluster recovery. Set your objectives first: what's the recovery point (how much data can you lose) and the recovery time (how long can you be down)? Those numbers, not tool preference, drive the cadence and destination.
Prerequisites: Permissions, Space, and a Safe Window
The BR commands run from a host with the Hadoop and HBase client configuration. The user needs write permission on the backup destination path and, depending on your cluster's security mode, appropriate HBase privileges for snapshot and exportSnapshot operations.
The destination must exist and be writable before the job starts. For HDFS, verify with hdfs dfs -ls hdfs:///backups/hbase/. For object storage, verify the filesystem connector is on the classpath and that the credential configuration resolves. A quick pre-flight: hdfs dfs -touchz hdfs:///backups/hbase/.preflight and confirm the zero-byte file appears.
Schedule the backup window outside peak write hours if full exports are large, though the snapshot step itself is fast and non-blocking for reads and writes. Compactions and region splits during the export of a snapshot are handled by the tool, since the snapshot is an immutable file-set view. The real duration cost is copying the frozen files to the destination, which scales with changed data volume.
One prerequisite people skip: a restore target. Know in advance where you'd restore a table, whether that's the same cluster under a renamed table or a separate recovery cluster. Restores that create a new table name (-m append-style or table rename) are safer than overwriting a live table.
Step-by-Step: Taking a Full Backup with the BR Tool
The following is the standard sequence for an HBase 2.x deployment using the built-in tooling.
1: Create the backup root directory once. In the HBase shell, run backup set_backup_dir 'hdfs:///backups/hbase'. Confirm with backup show_backup_dir. This becomes the metadata home for all subsequent images. 2: List the working tables. In a script or by hand, capture list output and select the tables to protect. Avoid system tables (hbase:meta, hbase:namespace) in ordinary user-table backups; they're managed separately and should not be casually restored. 3: Run the full backup. The canonical command is backup create 'full-backup-' -t ',' or omit -t to include all user tables. The -w flag sets concurrency; for large tables, more workers speed up the copy but consume destination bandwidth. For cross-cluster destinations, a value in the range of 10 to 50 is common; tune to your link. The tool takes a snapshot at the start, so the exported view is consistent even while writes continue. 4: Success check: enumerate the image. Run backup describe 'full-backup-' in the shell; it prints the tables included and the image state. A completed image should report success. If it reports an error or partial state, the backup is not usable for those tables, and you must investigate before relying on it. 5: Verify data footprint. On the destination, hdfs dfs -du -s -h /backups/hbase/ should show nonzero, plausible size. Zero bytes is a failure even if the command exits 0 in some configurations; file-count and size checks catch this. 6: Record the metadata. Save the backup identifier, timestamp, table list, HBase version, destination path, and the schema text files in one runbook entry. You'll need the identifier at restore time, and the version at cross-version restore time.
For a cadence: many teams run a weekly full and nightly incrementals. Confirm your version's incremental syntax in the shipped hbase backup help output before relying on a flag; incremental and WAL-based restore behavior differs across 2.4/2.5/2.6, and a runbook that assumes a flag exists is a silent failure waiting to happen. The supported method is to read the help output on your exact build and script to that.
Step-by-Step: Restoring from a BR Backup
Restore is where plans meet reality, so rehearse it on a non-critical table first.
1: Identify the image and table. backup describe '' lists tables in the image. Choose the table and the point in time: the base full image plus, if applicable, subsequent incremental images up to the desired timestamp. 2: Pick a safe target name. Decide whether you're restoring into a new table (recommended, using the tool's table-mapping option if present in your version) or over the existing one. A new destination table name prevents an accidental overwrite of a live production table during a mistaken restore. 3: Confirm schema exists. If restoring to a new cluster, create the table schema first using the stored describe output, unless your version's restore path recreates it. Schema mismatch is the most common restore failure; a column family missing on the destination either fails the restore or silently limits what's available. 4: Run the restore. The shell form backup restore '' -t '' (add a table-mapping flag if your version supports one) initiates the restore. For large tables, this copies files back into the HBase root and triggers region assignment. Watch the RegionServer logs for file-read errors, and watch HDFS -du on the target table directory to confirm files are landing. 5: Success check: row and table comparison. Immediately after, run count '' and scan '', {LIMIT => 5} to confirm the table opens and returns rows. Compare a representative sample key range and a timestamp column against the source where it still exists. A table that opens but returns fewer rows than expected usually means you stopped at the base image and missed an incremental. 6: Validate application reads. Point a read-only application instance at the restored table, or run the same query shape used in production. Row count alone can hide column-family gaps.
The key operational habit: never overwrite the production table during the first restore attempt. Restore to table_recovered, inspect, then rename or cut over deliberately.
Step-by-Step: Snapshot and Distcp for Large-Scale or Cross-Cluster Copy
For tables too large for routine full exports, or for a disaster-recovery standby, the snapshot-plus-copy route is standard.
1: Snapshot the table in place. In the shell: snapshot '', 'snap-'. The command returns immediately. Confirm with list_snapshots ''. The snapshot freezes the current HFile set, so subsequent writes go to new files and don't disturb it. 2: Export the snapshot to the destination. Use hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot snap- -copy-to hdfs:///backups/snapshots/snap- -mappers 16. The -mappers flag sets copy concurrency. This copies only the files referenced by the snapshot, which is why it's efficient for large tables. 3: Check completeness on the destination. Compare the file count and total bytes under the exported directory to the snapshot's manifest view, not to the live table directory, which may now contain newer files. The manifest is the authoritative list of what should exist. 4: Restore the snapshot. On the recovery cluster, ensure the table schema exists, then use clone_snapshot 'snap-', '' to materialize the table without copying the original files (when the snapshot is on the same cluster), or use the shell restore_snapshot path with the exported directory if your tooling follows that model. Verify with count and a sample scan. 5: Delete old snapshots deliberately. Snapshots pin storage. A snapshot holds deleted files alive beyond their normal cleanup. List them weekly with list_snapshots and remove ones past retention with delete_snapshot, then confirm HDFS usage drops where expected.
An important limit: HBase replication, which streams edits to a second cluster, is a high-availability mechanism, not a backup. It repeats deletions and bad writes. Keep it, but don't count it as your protection against user error.
Consistency, Transaction Logs, and the Restore Gap
Two subtleties separate a correct backup from a conflict-torn restore.
First is transactional consistency across tables. HBase does not offer snapshot-consistent backups spanning tables. If your tables were written in a transaction-like sequence by the application, the exported snapshots may reflect slightly different points in time. For multi-table logical consistency, take snapshots back-to-back and accept the small skew, or coordinate writes to a brief pause during the snapshot step. Document the skew you accept.
Second is the WAL tail. Snapshots do not include unflushed write-ahead-log edits. The BR tool's handling of WAL to bridge a backup point in time is version- and mode-dependent. In the common case, only committed, flushed data is in a snapshot's HFiles. If you need to capture writes between the last flush and the backup instant, your exact version's documentation governs; in practice, run a flush before the snapshot if application consistency demands it (flush ''), and accept that flush cost into your backup window.
On restore, treat the HBase Master log and RegionServer logs as first-class evidence. If a restore fails partway, logs tell you which family or region file was missing or corrupt. Retrying the identical restore without finding that error simply reproduces the failure.
Verify, Test, and Handle Edge Cases
A backup is only as good as the restore you can perform on demand, so schedule restore tests the way you schedule backups. Restore one representative table monthly into a scratch namespace, run count and a few key-range scans, and log the result. If the restore test fails, treat it as a production incident and fix the process, not the log.
Watch for these specific failure modes. A destination that silently fills during the export produces a partial image, so monitor free space. A table altered after a snapshot has a new schema version; restoring an old image into the current schema risks writing files under an incompatible family configuration, so validate schema compatibility rather than assuming it. A restore into a table that's still receiving data can conflict with live writes, so restore to a quiesced or separate table. Finally, cross-version restore (backup from 2.4, restore into 2.6, say) needs verification against that build's instructions; file formats are generally stable within 2.x, but the BR tool's tables and path layout changed across releases, and a runbook pinned only to “HBase 2” is a guess.
Size your storage around retention, not just current data. Keep at least two full backup generations and enough incrementals to cover your recovery point, and check free space on the destination before each run. Ops people learn this the hard way when the destination hits full at 3 a.m. and silently truncates the newest, most valuable image.
What Changes Across Environments and Versions
Since no current environment access or retrieval is available, the durable guidance is this: the commands above reflect the stable Apache HBase 2.x shell surface, but the BR tool moved and gained options across versions. Always run hbase backup help and hbase snapshot help on your exact build, and paste the relevant usage text into your runbook. Managed services (for example, hosted HBase on a cloud platform) may replace the shell-level commands with provider-specific APIs and snapshots that have their own retention and restore semantics; check the provider's documentation for your region and version rather than following the self-managed steps verbatim. The general principle endures: take a snapshot, export it off-cluster, verify with enumeration, restore into a safe target, and prove the restore on a schedule. The tooling changes; the discipline is the backup.