> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Backup and disaster recovery

> Protect the e6data metadata store in your own account, restore deleted files, and plan for node and zone failures in a CloudPrem deployment.

How-to guideApplies to: CloudPrem (AWS and Azure)

e6data keeps its state in a metadata bucket (AWS) or storage account (Azure) in your account, so you control its redundancy and backups. e6data doesn't state an RPO or RTO today and doesn't offer failover to a second region.

This page is about protecting data. To go back to an earlier software version after an upgrade, see [Rollbacks, failure modes, and recovery](https://docs.e6data.com/platform/upgrades/rollbacks-and-recovery.md).

## What needs protecting

| Item | Where it lives | Can it be rebuilt? |
| - | - | - |
| Your table data | Your data lake (S3 / Data Lake Storage) | Owned and backed up by you; e6data only reads it |
| Catalog registrations, saved SQL Editor tabs, Query History, usage tables | e6data metadata bucket (AWS) or storage account (Azure) in your account | No. Protect this store |
| Running pods: query clusters, Metadata Service, routing | Your EKS / AKS cluster | Yes. After a pod or node restart the operator recreates them from the e6data resources in the cluster and reads state back from the metadata store. Nothing to do |
| e6data resource definitions: NamespaceConfig, QueryRouter, QueryService (query clusters), MetadataServices, UsageStack, E6Catalog and StorageCredential (catalogs), AccessToken, plus the secrets and settings from the install steps | The Kubernetes API of your cluster | Not if the cluster is lost. Keep an encrypted copy (see [If you lose the cluster](#if-you-lose-the-cluster)). Some of these hold secrets, so never keep raw exports in plain Git |
| Users, roles, workspace records | e6data control plane | Held by e6data (see [Data that leaves your network](https://docs.e6data.com/platform/trust/data-that-leaves-your-network.md)) |

## Requirements

* Protect the metadata store with the options below. Don't use lifecycle rules that delete current files in the e6data bucket or container; Query History and catalog data would be lost. Rules that delete only old versions are safe.
* Zones are optional, but recommended for resilience: spread the cluster across 3 zones where the region has them. On both clouds, the engine NodePools list every configured zone. On Azure, system node pool zones must be set when the cluster is created.
* Query History retention is an e6data setting, not a storage rule. Ask your e6data contact to set it.

## Protect the metadata store

> [tab] AWS
>
> The standard install creates the metadata bucket with versioning, server-side encryption with S3-managed keys (SSE-S3, no KMS key by default), all public access blocked, ACLs off, and SSL-only access. For customer-managed keys, see [Encryption at rest](https://docs.e6data.com/platform/trust/encryption-at-rest.md).
>
> * **Encryption header policies:** e6data sends no encryption header. If your policy requires one, use the `Null`-condition form (deny only when a header is present and wrong). The strict form makes writes fail, and Query History and saved SQL Editor tabs are lost.
> * **Lifecycle rules:** a rule that expires only noncurrent versions (after 30 days) and incomplete uploads (after 7 days) is safe. Never expire current objects. e6data already expires its cached query results after 1 day.
> * **Restore:** remove the delete marker to bring a deleted object back. A restored Query History file shows again in Query History with no reinstall.
> * **Access logging** on the bucket works.

> [tab] Azure
>
> | Area | Standard install | What you can choose |
> | - | - | - |
> | Redundancy | Locally redundant (LRS) | Zone-redundant (ZRS) or geo-zone-redundant (GZRS). You can convert later with no downtime; a geo step takes at least 24 hours |
> | AKS system node pool | No zones set | Set zones when the cluster is created |
> | Query clusters | Not pinned to a zone | No setting needed |
>
> > [!WARNING]
> >
> > Decided at setup: AKS system node pool zones can't be changed on an existing pool. Hierarchical namespace can't be turned off once it's on. An existing account without it can be upgraded to Data Lake Storage Gen2 one way, if eligible ([Microsoft: upgrade to Data Lake Storage Gen2](https://learn.microsoft.com/en-us/azure/storage/blobs/upgrade-to-data-lake-storage-gen2-how-to), which includes the eligibility check). Choose the storage kind before install.
>
> Which protection works depends on the storage kind:
>
> | You need | Data Lake Storage Gen2 (hierarchical namespace on, the default) | Standard storage (hierarchical namespace off) |
> | - | - | - |
> | Versioning | Not available | Yes |
> | Soft delete | Yes | No: Azure blocks the endpoint e6data uses while soft delete is on |
> | Point-in-time restore | Not available | Not available |
> | Immutability (WORM) | No | No |
> | Diagnostic logs | Yes | Yes |
> | Azure Backup | Not available | No: setting it up turns soft delete back on, which breaks e6data |
>
> * **Option A (default):** soft delete and diagnostic logs.
> * **Option B (standard storage, chosen before install):** versioning and diagnostic logs.
> * Immutability can't be on the container e6data writes to, because e6data updates and deletes its own files. Keep WORM copies in a separate container or account.

## Steps (Azure)

### Option A: soft delete

Turn on soft delete for 7 days:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
az storage account blob-service-properties update \
  --account-name <STORAGE_ACCOUNT> --resource-group <RESOURCE_GROUP> \
  --enable-delete-retention true --delete-retention-days 7 \
  --enable-container-delete-retention true --container-delete-retention-days 7
```

Restore a deleted file:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
az storage fs list-deleted-path --account-name <STORAGE_ACCOUNT> -f <CONTAINER> \
  --path-prefix <FOLDER> --auth-mode login --query "[].{name:name,id:deletionId}" -o table
az storage fs undelete-path --account-name <STORAGE_ACCOUNT> -f <CONTAINER> \
  --deleted-path-name <PATH> --deletion-id <DELETION_ID> --auth-mode login
```

### Option B: versioning on standard storage

Create the account before install with hierarchical namespace off and versioning on. Leave soft delete off:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
az storage account create --name <STORAGE_ACCOUNT> --resource-group <RESOURCE_GROUP> --location <REGION> \
  --kind StorageV2 --sku Standard_LRS --hns false \
  --https-only true --min-tls-version TLS1_2 --allow-shared-key-access false --allow-blob-public-access false
az storage account blob-service-properties update \
  --account-name <STORAGE_ACCOUNT> --resource-group <RESOURCE_GROUP> \
  --enable-versioning true --enable-change-feed true
```

Then tell your e6data contact so the workspace is installed on this account, and give the workspace identity Storage Blob Data Contributor on it:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
az role assignment create --assignee <WORKSPACE_IDENTITY_CLIENT_ID> \
  --role "Storage Blob Data Contributor" \
  --scope $(az storage account show -n <STORAGE_ACCOUNT> -g <RESOURCE_GROUP> --query id -o tsv)
```

Restore an earlier version of a file:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
az storage blob list --account-name <STORAGE_ACCOUNT> -c <CONTAINER> --prefix <PATH> \
  --include v --auth-mode login --query "[].{name:name, version:versionId}" -o table
az storage blob copy start --account-name <STORAGE_ACCOUNT> --auth-mode login \
  --destination-container <CONTAINER> --destination-blob <PATH> \
  --source-uri "https://<STORAGE_ACCOUNT>.blob.core.windows.net/<CONTAINER>/<PATH>?versionid=<VERSION_ID>"
```

Add a lifecycle rule that deletes old versions after your retention period.

### Diagnostic logs (both options)

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
az monitor diagnostic-settings create --name e6data-metadata-logs \
  --resource $(az storage account show -n <STORAGE_ACCOUNT> -g <RESOURCE_GROUP> --query id -o tsv)/blobServices/default \
  --workspace <LOG_ANALYTICS_WORKSPACE_ID> \
  --logs '[{"category":"StorageRead","enabled":true},{"category":"StorageWrite","enabled":true},{"category":"StorageDelete","enabled":true}]'
```

### A copy outside the account

Copy the data to a separate storage account (for example with AzCopy), not with Azure Backup.

## If you lose the cluster

A pod or node restart needs no action. Losing the whole EKS or AKS cluster is different: the e6data resource definitions live in the cluster, so keep a copy of them as well as the metadata store.

**1. Export the workspace's e6data resources and Secrets**

Run this regularly. The exports hold secrets: catalog definitions can include client secrets or tokens, AccessTokens include the token value, and the Secret export includes the TLS key. Store the files encrypted with restricted access (for example SOPS or Sealed Secrets, or your secrets vault). Keep only secret-free settings in Git.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
NS=<workspace-namespace>
for kind in namespaceconfigs queryrouters queryservices metadataservices usagestacks e6catalogs storagecredentials accesstokens; do
  kubectl get "$kind" -n "$NS" -o yaml > "backup-$kind.yaml"
done
# Secrets the resources refer to (for example envoy-tls and catalog secrets)
kubectl get secrets -n "$NS" \
  --field-selector 'type!=kubernetes.io/service-account-token,type!=helm.sh/release.v1' \
  -o yaml > backup-secrets.yaml
```

Also keep the values you used in the install steps (variables, operator values, certificates).

**2. Reinstall on a new cluster**

Build a new cluster and install e6data with the install steps ([AWS](https://docs.e6data.com/platform/deploy/aws-cloudprem/configure-registry-vpc-eks-networking.md) · [Azure](https://docs.e6data.com/platform/deploy/azure-cloudprem/configure-registry-kubernetes-networking.md)), pointing at the same metadata bucket or storage account.

**3. Re-apply and verify**

Re-apply the Secrets first, then the e6data resources. Remove the fields the old cluster added before applying, for example with `yq`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
CLEAN='del(.items[].metadata.resourceVersion, .items[].metadata.uid, .items[].metadata.creationTimestamp, .items[].metadata.managedFields, .items[].status)'
yq "$CLEAN" backup-secrets.yaml | kubectl apply -n "$NS" -f -
for kind in namespaceconfigs queryrouters queryservices metadataservices usagestacks e6catalogs storagecredentials accesstokens; do
  yq "$CLEAN" "backup-$kind.yaml" | kubectl apply -n "$NS" -f -
done
```

Then check the workspace ([AWS](https://docs.e6data.com/platform/deploy/aws-cloudprem/verify-deployment.md) · [Azure](https://docs.e6data.com/platform/deploy/azure-cloudprem/verify-deployment.md)).

> [!WARNING]
>
> Not tested yet: restoring a workspace into a new cluster this way. Don't rely on it in your recovery plan until e6data confirms it.

## Node and zone failure

| Event | What happens | Your action |
| - | - | - |
| A node fails | Running queries on it fail. e6data replaces the node; on AWS a lost executor node was replaced in about 40 to 70 seconds | Re-run failed queries |
| A zone fails | Quota is regional, so no extra quota is needed; zone capacity isn't reserved. With a single NAT gateway (as in e6data's install), losing its zone cuts outbound access (control plane, image pulls) for every zone | Restart clusters. For zone resilience, use zone-redundant storage (ZRS or better on Azure) and a NAT gateway per zone or another egress path |
| A region fails | Not handled by e6data | e6data doesn't provide or validate a second-region setup today |

## Cost impact

* ZRS and GZRS cost more than LRS.
* Versioning and soft delete keep deleted and overwritten bytes. Extra storage is about the bytes changed per day times the retention days. Start with a short retention.

## Preflight check

> [tab] AWS
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> aws s3api get-bucket-versioning --bucket <METADATA_BUCKET>
> ```
>
> Expected: `"Status": "Enabled"`.

> [tab] Azure
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> az storage account show -n <STORAGE_ACCOUNT> --query "{sku:sku.name, hns:isHnsEnabled}"
> az storage account blob-service-properties show --account-name <STORAGE_ACCOUNT> \
>   --query "{softDelete:deleteRetentionPolicy.enabled, versioning:isVersioningEnabled}"
> ```
>
> Expected: the redundancy and protection you chose, and never soft delete together with hierarchical namespace off.

## Verify

Delete a test file in the metadata store, restore it, and run a query. On Azure, a deleted SQL Editor tab and a Query History file were restored byte for byte from soft delete, and queries kept running.

## Troubleshooting

| Symptom | Cause | Fix |
| - | - | - |
| Catalogs don't load; `409 EndpointUnsupportedAccountFeature` (Azure) | Soft delete is on a storage account with hierarchical namespace off, often turned on by Azure Backup | Turn soft delete and point-in-time restore off; remove the backup protection |
| Saves fail, "path is immutable" (Azure) | An immutability policy on the e6data container | Remove it; keep WORM copies elsewhere |
| Query History or catalogs missing | A lifecycle rule deleted files in the e6data store | Remove the rule; restore from soft delete or versions |

## Limitations

* RPO and RTO: e6data doesn't state them today.
* Managed failover to a second region: Not offered.
* Azure Backup on the metadata storage: Not supported.
* Immutability on the e6data container: Not supported.

## See also

* [Rollbacks, failure modes, and recovery](https://docs.e6data.com/platform/upgrades/rollbacks-and-recovery.md) - going back to an earlier software version.
* [If e6data's control plane is down](https://docs.e6data.com/platform/upgrades/control-plane-outage.md) - what keeps working during an outage.
* [Encryption at rest](https://docs.e6data.com/platform/trust/encryption-at-rest.md) - keys for the metadata store.
* [Shared responsibility](https://docs.e6data.com/platform/trust/responsibilities-matrix.md) - who owns backups and recovery.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.