How to decommission your deployment¶
When Charmed MongoDB is no longer required, it is important to decommission it securely to avoid accidental retention or exposure of sensitive data such as credentials, user data, or operational metadata.
Recommended Decommissioning Steps¶
1. Stop Client Access¶
Ensure all applications and clients are disconnected from MongoDB. Revoke any application credentials or database users that will no longer be used.
If you used the Database Integrator charm to integrate your application with Charmed MongoDB, remove all the integration specified in Remove the integration.
2. Backup (Optional)¶
If required, take a final backup of the database before removal. See: How to back up and restore.
3. Remove Charmed MongoDB applications¶
Caution
If you remove Charmed MongoDB as shown below, you will lose all data stored in MongoDB.
Remove all the applications related to your deployment, including:
Shards
Config servers
Replica sets
Mongos
Database integrator charms
To ensure data is securely removed, destroy all associated storage:
juju remove-application <application-name> --destroy-storage
4. Remove the environment¶
If the entire environment is no longer needed, destroy the Juju model to ensure no residual resources remain.
juju destroy-model <model-name> --destroy-storage
Then, remove the Juju controller:
juju destroy-controller <controller-name>
5. Remove Juju¶
Caution
If you remove Juju as shown below, you will lose access to any other applications you have hosted on Juju.
To remove Juju altogether, enter:
sudo snap remove juju --purge
See: How to remove Juju