Back Up and Restore¶
Store and transfer backups encrypted.
Back up¶
-
Create an API token for an admin: in Users, open the user, and in API Tokens, click Create Token.
-
Download a backup:
curl -fOJ http://<host-ip>:5020/api/v1/backup \ -H "Authorization: Bearer ellaims_..."This saves
ims-backup-<time>.tar.gz. In a cluster, back up from any node.
-
Create an API token for an admin: in Users, open the user, and in API Tokens, click Create Token.
-
Open the API:
kubectl port-forward -n ella svc/ella-ims 5020:5020 -
Download a backup:
curl -fOJ http://localhost:5020/api/v1/backup \ -H "Authorization: Bearer ellaims_..."This saves
ims-backup-<time>.tar.gz.
Restore¶
-
Log in as an admin, and keep the token:
TOKEN=$(curl -s http://<host-ip>:5020/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"email": "[email protected]", "password": "..."}' | jq -r .result.token) -
Restore the backup:
curl http://<host-ip>:5020/api/v1/restore \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/gzip" \ --data-binary @ims-backup-<time>.tar.gzIn a cluster, restore on the leader. Another node answers
421with the leader's address.
-
Open the API of the leader's pod, named on the Cluster page, or
ella-ims-0for a standalone node:kubectl port-forward -n ella pod/ella-ims-<n> 5020:5020 -
Log in as an admin, and keep the token:
TOKEN=$(curl -s http://localhost:5020/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"email": "[email protected]", "password": "..."}' | jq -r .result.token) -
Restore the backup:
curl http://localhost:5020/api/v1/restore \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/gzip" \ --data-binary @ims-backup-<time>.tar.gz
Disaster recovery¶
Use this procedure when a cluster lost a majority of its nodes, or a standalone node was lost.
- Install Ella IMS on a new host, as in Install. For a cluster, add a
clusterblock to the configuration file. - Open
http://<host-ip>:5020in a browser and initialize it with a temporary user. - Restore the backup with that user, as in Restore.
- For a standalone deployment, stop here.
-
Log in with a user from the backup, and add the other nodes, as in Deploy a High Availability Cluster, steps 2 to 4. Delete the data of any node that was in the old cluster first:
sudo snap stop ella-ims.imsd sudo rm -rf /var/snap/ella-ims/common/ims.db* /var/snap/ella-ims/common/node.db* /var/snap/ella-ims/common/raft sudo snap start ella-ims.imsd
-
Delete the release and its volumes:
helm uninstall ella-ims --namespace ella --wait kubectl delete pvc -n ella -l app.kubernetes.io/name=ella-ims -
Deploy it again, with the same
values.yaml:helm install ella-ims oci://ghcr.io/ellanetworks/charts/ella-ims --version <version> --namespace ella -f values.yaml -
Initialize it with a temporary user, as in Deploy a High Availability Cluster, step 2.
- Restore the backup with that user, as in Restore.