This document outlines the steps to decommission an org from a hybrid deployment. Decommissioning
an org means deleting all data related to the org across all Cassandra pods in all Kubernetes
clusters.
Limitations
Only one org can be decommissioned at a time. Decommissioning multiple orgs simultaneously is not
supported.
Get the org name
Some commands in these instructions require you to use a properly formatted org name.
To get the org name for use in commands on this page:
Retrieve the org name from the org'soverrides.yamlfile.
If the org name contains any dashes ("-"), replace them with underscores ("_").
Instructions
Follow these instructions to decommission an org from a hybrid deployment.
Back up the org
If it's not already enabled, enable backups on the hybrid deployment. In multi-region
setups, use the hybrid deployment operating in the primary region. SeeCassandra backup overviewfor information on hybrid backups.
Trigger a hybrid backup job using the following command:
TheBACKUP_JOB_NAMEcan be any valid container name.
Once the backup job completes, use the "Check the status of the backup job" and
"Check the backup logs" instructions inMonitoring backupsto verify the backup was successful.
(Optional)If you have configured Apigee Telemetry (Metrics and Logger) on the org to be deleted, follow these steps to reconfigure them so that the metrics and log data apply to a new org/project.
Run this command for the org where you want to send the data. Be sure to use theoverrides.yamlfile for the org. For example, if the org to be decommissioned is
"test-dev" theoverrides.yamlfile should contain anorg: test-devorg field.
For each name in the list created earlier from theapigee apigee-cassandra-default-0,
run the following commands:
drop keyspaceKEYSPACE_NAME;
Exit from the Cassandra debug client pod.
Perform a rolling restart of all Cassandra pods. Restarting the Cassandra pods can be done in
any order as long as only one Cassandra pod is restarted at a time. For multi-region
deployments, perform a rolling restart on all Cassandra pods in each hybrid region.
Run the following command and verify the state shows "Running":
kubectl get apigeeds -nAPIGEE_NAMESPACE
Restart a single Cassandra pod with the following command:
kubectl delete pod -nAPIGEE_NAMESPACECASSANDRA_POD_NAME
Wait for the pod to reachRunningstate using:
kubectl get pods -nAPIGEE_NAMESPACE
Restart the next Cassandra pod.
After executing thecqlshcommands, run the following commands on all
Cassandra pods in the hybrid deployment. For multi-region hybrid deployments, run the
commands on all Cassandra pods in all hybrid regions.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[[["\u003cp\u003eThis guide outlines the process for decommissioning an organization (org) from a hybrid deployment, which involves deleting all its data across Cassandra pods in all Kubernetes clusters.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, it is crucial to ensure there is no live traffic directed to the org that is being removed, and it is noted that only one org can be decommissioned at a time.\u003c/p\u003e\n"],["\u003cp\u003eThe procedure includes backing up the org's data, optionally reconfiguring Apigee Telemetry to point towards a new org if it has been enabled, and deleting the org's Kubernetes resources, including virtual hosts, environments, and the org itself.\u003c/p\u003e\n"],["\u003cp\u003eThe most critical step is deleting the org data from the hybrid deployment by executing commands in a \u003ccode\u003ecqlsh\u003c/code\u003e prompt and on each Cassandra pod, to ensure that all org-related information is removed from the system.\u003c/p\u003e\n"],["\u003cp\u003eA crucial step at the end is to perform a rolling restart on all the Cassandra pods, ensuring the process is done one pod at a time, and verify the state of each pod as it goes.\u003c/p\u003e\n"]]],[],null,["# Decommission a hybrid org\n\n| You are currently viewing version 1.14 of the Apigee hybrid documentation. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis document outlines the steps to decommission an org from a hybrid deployment. Decommissioning\nan org means deleting all data related to the org across all Cassandra pods in all Kubernetes\nclusters.\n| Please ensure there is no live traffic going to the org you plan to remove.\n\nLimitations\n-----------\n\n\nOnly one org can be decommissioned at a time. Decommissioning multiple orgs simultaneously is not\nsupported.\n\nGet the org name\n----------------\n\nSome commands in these instructions require you to use a properly formatted org name.\n\nTo get the org name for use in commands on this page:\n\n\n1. Retrieve the org name from the org's `overrides.yaml` file.\n2. If the org name contains any dashes (\"-\"), replace them with underscores (\"_\").\n\nInstructions\n------------\n\nFollow these instructions to decommission an org from a hybrid deployment.\n\n1. Back up the org\n 1. If it's not already enabled, enable backups on the hybrid deployment. In multi-region setups, use the hybrid deployment operating in the primary region. See [Cassandra backup overview](/apigee/docs/hybrid/v1.14/cassandra-backup-overview) for information on hybrid backups.\n 2. Trigger a hybrid backup job using the following command:\n\n ```\n kubectl create job -n APIGEE_NAMESPACE --from=cronjob/apigee-cassandra-backup BACKUP_JOB_NAME\n ```\n\n \u003cbr /\u003e\n\n\n The \u003cvar translate=\"no\"\u003eBACKUP_JOB_NAME\u003c/var\u003e can be any valid container name.\n 3. Once the backup job completes, use the \"Check the status of the backup job\" and\n \"Check the backup logs\" instructions in [Monitoring backups](/apigee/docs/hybrid/v1.14/monitor-cassandra-backups)\n to verify the backup was successful.\n\n2. **(Optional)** If you have configured Apigee Telemetry (Metrics and Logger) on the org to be deleted, follow these steps to reconfigure them so that the metrics and log data apply to a new org/project.\n 1. Run this command for the org where you want to send the data. Be sure to use the `overrides.yaml` file for the org. For example, if the org to be decommissioned is \"test-dev\" the `overrides.yaml` file should contain an `org: test-dev` org field. \n\n ```\n helm upgrade telemetry apigee-telemetry/ \\\n --namespace APIGEE_NAMESPACE \\\n --atomic \\\n -f OVERRIDES_FILE.yaml\n ```\n | **Note:** If you see an error saying `Error: UPGRADE FAILED: \"`*ORG_NAME*`\" has no deployed releases`, replace `upgrade` with `install` and try the command again.\n 2. Run this command, making sure to use the correct org/project: \n\n ```\n kubectl -n APIGEE_NAMESPACE get apigeetelemetry apigee-telemetry -oyaml | grep `gcpProjectID:`\n ```\n3. Delete the org's Kubernetes resources from the hybrid deployment.\n 1. Verify the current context is the correct context for the source Kubernetes cluster: \n\n ```\n kubectl config current-context\n ```\n\n If needed, set the Kubernetes context.\n\n\n List your current contexts to see the context name for each cluster: \n\n ```\n kubectl config get-contexts\n ```\n\n\n Set the context to the cluster and region you want to decommission: \n\n ```\n kubectl config use-context CONTEXT_NAME\n ```\n\n\n Where \u003cvar translate=\"no\"\u003eCONTEXT_NAME\u003c/var\u003e is the context name for the cluster and region.\n\n\n For example: \n\n kubectl config get-contexts\n CURRENT NAME CLUSTER AUTHINFO NAMESPACE\n gke_example-org-1_us-central1_example-cluster-1 gke_example-org-1_us-central1_example-cluster-1 gke_example-org-1_us-central1_example-cluster-1 apigee\n * gke_example-org-1_us-central1_example-cluster-2 gke_example-org-1_us-central1_example-cluster-2 gke_example-org-1_us-central1_example-cluster-2 apigee\n gke_example-org-1_us-west1_example-cluster-2 gke_example-org-1_us-west1_example-cluster-2 gke_example-org-1_us-west1_example-cluster-2 apigee\n\n kubectl config use-context gke_example-org-1_us-west1_example-cluster-2\n\n 2. Delete the virtualhost. Repeat this for each environment group:\n\n ```\n helm -n APIGEE_NAMESPACE delete ENV_GROUP_NAME\n ```\n 3. Delete the environments. Repeat this for each environment: \n\n ```\n helm -n APIGEE_NAMESPACE delete ENV_NAME\n ```\n 4. Delete the Apigee org. \n\n ```\n helm -n APIGEE_NAMESPACE delete ORG_NAME\n ```\n4. Delete the org data from the hybrid deployment. **Once this step is complete all org data\n will be gone from the hybrid deployment.**\n 1. Exec into the `apigee-cassandra-default-0` pod: \n\n ```\n kubectl exec -it -n APIGEE_NAMESPACE apigee-cassandra-default-0 -- /bin/bash\n ```\n 2. Execute the following command. Copy the list of all the names that are shown in the output. This list will be needed later. \n\n ```\n find /opt/apigee/data/apigee-cassandra/ -iname '*ORG_NAME_hybrid' -type d -maxdepth 2 -printf \"%f\\n\"\n ```\n\n\n See [Get org name](#get-org-name) for instructions on how to find and prepare the\n \u003cvar translate=\"no\"\u003eORG_NAME\u003c/var\u003e.\n\n Exit from the `apigee-cassandra-default-0` pod.\n 3. Create a Cassandra debug client pod as described in [Create a client container for debugging](/apigee/docs/api-platform/troubleshoot/playbooks/cassandra/ts-cassandra#create-a-client-container-for-debugging). Move on to the next step after getting a `cqlsh` prompt.\n 4. Execute the following commands in the `cqlsh` prompt: \n\n ```\n desc keyspaces;\n ```\n\n Make sure this command returns no errors.\n\n For each name in the list created earlier from the `apigee apigee-cassandra-default-0`,\n run the following commands: \n\n ```\n drop keyspace KEYSPACE_NAME;\n ```\n\n Exit from the Cassandra debug client pod.\n 5. Perform a rolling restart of all Cassandra pods. Restarting the Cassandra pods can be done in any order as long as only one Cassandra pod is restarted at a time. For multi-region deployments, perform a rolling restart on all Cassandra pods in each hybrid region. Run the following command and verify the state shows \"Running\":\n\n ```\n kubectl get apigeeds -n APIGEE_NAMESPACE\n ```\n\n Restart a single Cassandra pod with the following command: \n\n ```\n kubectl delete pod -n APIGEE_NAMESPACE CASSANDRA_POD_NAME\n ```\n\n Wait for the pod to reach `Running` state using: \n\n ```\n kubectl get pods -n APIGEE_NAMESPACE\n ```\n\n Restart the next Cassandra pod.\n 6. After executing the `cqlsh` commands, run the following commands on all Cassandra pods in the hybrid deployment. For multi-region hybrid deployments, run the commands on all Cassandra pods in all hybrid regions. \n\n ```\n kubectl exec -it -n APIGEE_NAMESPACE CASSANDRA_POD_NAME -- /bin/bash\n ``` \n\n ```\n find /opt/apigee/data/apigee-cassandra/ -iname '*ORG_NAME_hybrid' -type d -maxdepth 2\n ```\n\n See [Get org name](#get-org-name) for instructions on how to find and prepare the\n \u003cvar translate=\"no\"\u003eORG_NAME\u003c/var\u003e. \n\n ```\n find /opt/apigee/data/apigee-cassandra/ -iname '*ORG_NAME_hybrid' -type d -maxdepth 2 -exec rm -rf {} +\n ```\n 7. Exit from the Cassandra pod."]]