Home / Keptn v1 Docs / Release 0.18.x / Operate Keptn / Back up and restore Keptn
To secure all your data in your project’s Git repository, as well as all events that have occurred for these projects, you must back up the data within the Configuration Service, the MongoDB, and credentials to your project’s Git upstream repos (if you have configured those). The following sections describe how to back up that data and how to restore it.
Note: These instructions do not cover backing up any Helm- or Istio-related configurations.
⚠️ Please make sure your kubectl
is connected to the cluster where Keptn is running.
This section describes how to back up your Keptn and store it on your local machine.
First, create a local backup directory containing all data within the Git repos of the configuration-service. To do so, please execute the following command:
Verify that the data has been copied correctly to your local machine by checking the content of the directory you just created.
This should include all projects you have onboarded with Keptn and a lost+found
directory, which can be ignored.
The next step is to create a backup of the mongodb database in the keptn-datastore
namespace using the mongodump
tool.`
Create a directory for the MongoDB backup:
Copy the data from the MongoDB to your local directory:
For projects where you have configured a Git upstream repository, you should back up the Kubernetes secrets needed to access those. To do so, please execute the following command for each project for which you have configured an upstream repo:
This section describes how to restore data from your Keptn projects on a fresh Keptn installation using the data you have stored on your machine using the instructions above.
Copy the directory containing all Git repositories to the configuration-service:
To make sure the Git repositories within the configuration service are in a consistent state, they need to be reset to the current HEAD. To do so, please execute the following commands:
Copy the content of the mongodb-backup directory you have created earlier into the pod running the MongoDB:
Import the MongoDB dump into the database using the following command:
To re-establish the communication between the configuration-service and your projects’ upstream repositories, restore the Kubernetes secrets you have previously stored in the keptn-backup
directory , using kubectl apply
:
After executing these steps, your projects and all events should be visible in the Keptn Bridge again.