# Backup + restore your cluster

Backing up your UltiHash cluster ensures that you can recover from data loss or corruption. Backups allow you to capture the full state of the cluster, including configuration and stored data, so you can restore it in-place or in a separate environment if needed.

***

### Backup the cluster

You should back up your UltiHash cluster regularly to protect against accidental data loss, corruption, or infrastructure failures. The backup process captures the entire Kubernetes namespace where the cluster is deployed.

#### How to create a backup

Use [Velero](https://velero.io/) to create a backup of the Kubernetes namespace containing your UltiHash cluster:

```
velero backup create <backup_name> --include-namespaces <namespace_name> --wait
```

* Replace \<backup\_name> with a unique name for the backup.
* Replace \<namespace\_name> with the Kubernetes namespace where UltiHash is deployed.
* The --wait flag ensures the command waits until the backup is complete before exiting.<br>

Perform backups frequently enough that you can avoid substantial data loss if a disaster occurs.

***

### Restore the cluster

If data is lost or corrupted, you can restore your UltiHash cluster from a previously created backup. Restores can be performed in-place (into the same cluster) or in a separate environment, which is useful for migrations or testing recovery procedures.

#### How to restore from a backup

Run the following Velero command, specifying the name of the backup you want to restore:

```
velero restore create <restore_name> --from-backup <backup_name> --wait
```

* Replace \<restore\_name> with a name for the restore operation.
* Replace \<backup\_name> with the name of the backup you are restoring from.
* The --wait flag ensures the command waits until the restore is complete before exiting.

Restoring to a separate environment is often useful when migrating a cluster or testing your disaster recovery plan.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ultihash.io/administration/backup-+-restore-your-cluster.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
