RESTORE brings tables, databases, or the whole cluster back from a BACKUP archive stored on local or remote storage.
RESTORE reverses data loss or corruption by rebuilding objects exactly as they were at BACKUP time, including schema, data, and TTL rules.
ClickHouse lets you restore a single table, an entire database, or the full cluster. Pick the smallest scope that fixes the issue to finish faster.
Specify a disk alias or S3 path used during BACKUP. RESTORE verifies the manifest before writing any data, preventing mismatched versions.
Use RESTORE TABLE, DATABASE, or ALL. Optional SETTINGS fine-tune concurrency and throttling. See syntax section below.
The query in the Example section recreates OrderItems
from an S3 backup taken last night. The table becomes immediately queryable.
Add the AS new_name
clause to load data into a differently named table for verification before swapping.
Run RESTORE on a replica first, validate row counts, then fail over. Always match ClickHouse versions between backup and restore nodes.
Restoring to the wrong path or skipping the --host mapping in distributed setups are typical errors. See the mistakes section.
Yes. Use AS new_table
after the source to rename during restore, allowing side-by-side validation.
RESTORE acquires metadata locks but streams data in the background. Non-conflicting queries can run concurrently, yet expect slower reads until completion.
Set structure_only = 1
in SETTINGS. ClickHouse will recreate the table definitions without copying data.