Skip to content

Back Up and Restore

Store and transfer backups encrypted.

Back up

  1. Create an API token for an admin: in Users, open the user, and in API Tokens, click Create Token.

  2. 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.

  1. Create an API token for an admin: in Users, open the user, and in API Tokens, click Create Token.

  2. Open the API:

    kubectl port-forward -n ella svc/ella-ims 5020:5020
    
  3. Download a backup:

    curl -fOJ http://localhost:5020/api/v1/backup \
      -H "Authorization: Bearer ellaims_..."
    

    This saves ims-backup-<time>.tar.gz.

Restore

  1. 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)
    
  2. 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.gz
    

    In a cluster, restore on the leader. Another node answers 421 with the leader's address.

  1. Open the API of the leader's pod, named on the Cluster page, or ella-ims-0 for a standalone node:

    kubectl port-forward -n ella pod/ella-ims-<n> 5020:5020
    
  2. 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)
    
  3. 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.

  1. Install Ella IMS on a new host, as in Install. For a cluster, add a cluster block to the configuration file.
  2. Open http://<host-ip>:5020 in a browser and initialize it with a temporary user.
  3. Restore the backup with that user, as in Restore.
  4. For a standalone deployment, stop here.
  5. 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
    
  1. 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
    
  2. 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
    
  3. Initialize it with a temporary user, as in Deploy a High Availability Cluster, step 2.

  4. Restore the backup with that user, as in Restore.