> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/server-update-and-maintenance/maintenance/backup-and-restore.md).

# Backup and restore

Back up and restore your database and the data of the agentic features. This page is for SonarQube Server 2026.5.

## Backing up data <a href="#backing-up-data" id="backing-up-data"></a>

Back up your database with the backup tools your database provides. You can back it up while SonarQube Server is running.

## Backing up the agentic features <a href="#agentic-features" id="agentic-features"></a>

If you deploy the agentic features, include their data in your backup:

| Data                    | Where it lives                                                                                                                                                                                                                                                                                                                      | What to do                                                                                                                                                                                                                                                                                              |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Shared signing secret   | On Kubernetes, the Secret that `agenticSigningSecret.existingSecret` references. On Docker Compose, `AGENTIC_SIGNING_SECRET` in the `.env` file                                                                                                                                                                                     | Back it up. On Kubernetes, you create it yourself, outside the deployment. With the Docker Compose bundle generator, the generator creates it. Every per-component key is derived from it. Without it, the components cannot authenticate to each other                                                 |
| Settings encryption key | The key file SonarQube Server uses, `~/.sonar/sonar-secret.txt` by default or the path set by `sonar.secretKeyPath`. On Kubernetes, it is the Secret that `sonarSecretKey` names, and the chart mounts it into the Agent Orchestrator as well. With the Docker Compose bundle, it is the file you pass to `--sonar-secret-key-file` | Back it up. SonarQube Server encrypts the LLM provider secrets with it, and the Orchestrator decrypts them with it. Without it, neither can decrypt the stored secrets, see [Sensitive settings](https://docs.sonarsource.com/sonarqube-server/instance-administration/security/encrypting-settings.md) |
| Job state               | The SonarQube Server database, where the Agent Orchestrator keeps it                                                                                                                                                                                                                                                                | Nothing more. Your database backup covers it                                                                                                                                                                                                                                                            |
| Job artifacts           | Shared storage                                                                                                                                                                                                                                                                                                                      | Back up the storage according to how long you need past results. Job artifacts are deleted automatically after 30 days by default, see [Setting up shared storage](https://docs.sonarsource.com/sonarqube-server/server-installation/ai-agents/shared-storage.md#retention)                             |
| Vortex analysis context | Shared storage, at the location set by the `sonar.agentic.storage.*` properties, see [Configuration reference](https://docs.sonarsource.com/sonarqube-server/server-installation/ai-agents/configuration-reference.md#server-context-storage)                                                                                       | Include it in your backup. Job housekeeping does not delete it. Losing it costs analysis precision, not correctness, see [Installation overview](https://docs.sonarsource.com/sonarqube-server/server-installation/ai-agents/installation-overview.md#data-lifecycle)                                   |

## Restoring data <a href="#restoring-data" id="restoring-data"></a>

To restore your data from a backup, follow these steps. Restoring also triggers a full reindexing, see [Reindexing](https://docs.sonarsource.com/sonarqube-server/server-update-and-maintenance/maintenance/reindexing.md).

1. Stop SonarQube Server.
2. Restore the backup.
3. If you deploy the agentic features, restore the same shared signing secret, so the components derive the same keys, and the same settings encryption key, so SonarQube Server and the Agent Orchestrator can decrypt the stored LLM provider secrets.
4. Drop the Elasticsearch indexes by deleting the contents of the `<sonarqubeHome>/data/es9` directory.
5. Start SonarQube Server.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/server-update-and-maintenance/maintenance/backup-and-restore.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
