> 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/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/deploy-databases.md).

# Step 1: Deploy the primary and replica databases

In SonarQube Server 2025.4, the first step of the disaster recovery setup for the Data Center Edition (DCE) deployed on Kubernetes consists in deploying the primary and replica databases.

The setup instructions are based on a [Disaster recovery architecture example with Azure resources](/sonarqube-server/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/architecture-example.md).

Deploy the primary and replica PostgreSQL databases on Azure as follows:

1. On the Azure Database for PostgreSQL flexible server creation page of your primary database, select your subscription and resource group.
2. In **Server details** > **Compute + storage**, select **Configure server**. A new pane opens.

<div align="left"><figure><img src="https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-0b0b14d9308cf764badbec521b32dbc16b6453da%2Fsonarqube-dce-disaster-recovery-configure-azure-database.png?alt=media" alt="In the Server details of your primary Azure database, select Configure server"><figcaption></figcaption></figure></div>

3. In **Backups**, enable the **Geo-redundancy**.

<div align="left"><figure><img src="https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-0b7acc9dc53a44cb2fa7f5cf1a149a00894a571f%2Fsonarqube-dce-disaster-recovery-azure%20database-enable-geo-redundancy.png?alt=media" alt="Enable the geo-redundancy by selecting the Recover from regional outage or disaster option"><figcaption></figcaption></figure></div>

4. Once the primary database has been deployed, create the replica database. To do so, go to the primary database resource page > **Settings >** **Replication >** **Create replica**. Ensure that you select a different **Availability zone** than for the primary database.

<div align="left"><figure><img src="https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-aae48249dd31fde28ea7c470fc6393bbad18572f%2Fsonarqube-dce-disaster-recovery-azure-replica-database-availability-zone.png?alt=media" alt="Create the replica database and set a different Availability zone that for the primary database"><figcaption></figcaption></figure></div>

5. Create virtual endpoints: go to **Database Settings** > **Replication** > **Virtual endpoints**.

<figure><img src="https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-ae5408466ccae9e4083c81a9d6ec6db5c65d934f%2Fsonarqube-dce-disaster-recovery-azure-front-door-endpoints-command.png?alt=media" alt=""><figcaption></figcaption></figure>

The following pane is displayed.

<div align="left"><figure><img src="https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-cb41ef30301beb8caa7695b821170cef26d326ac%2Fsonarqube-dce-disaster-recovery-azure-front-door-create-virtual-endpoints.png?alt=media" alt=""><figcaption></figcaption></figure></div>

## Related pages <a href="#related-pages" id="related-pages"></a>

* [Disaster recovery architecture example with Azure resources](/sonarqube-server/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/architecture-example.md)
* [Step 2: Set up the primary and replica clusters on AKS](/sonarqube-server/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/set-up-clusters-on-aks.md)
* [Step 3: Configure the Azure Front Door](/sonarqube-server/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/configure-azure-front-door.md)
* [Step 4: Test failover scenarios](/sonarqube-server/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/test-failover-scenarios.md)


---

# 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/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/deploy-databases.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.
