Skip to content

Commit

Permalink
pitr limitation added
Browse files Browse the repository at this point in the history
  • Loading branch information
wojcik-dorota committed Feb 11, 2025
1 parent 04624b2 commit cc1177c
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 56 deletions.
10 changes: 4 additions & 6 deletions docs/platform/concepts/backup-to-another-region.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: About backup to another region for Aiven services
title: Backup to another region for Aiven services
limited: true
sidebar_label: About backup to another region
sidebar_label: Backup to another region
---

import RelatedPages from "@site/src/components/non-swizzled/RelatedPages";
Expand All @@ -13,8 +13,6 @@ This feature is in [limited availability](/docs/platform/concepts/beta_services)
Contact your account team to enable it.
:::

## About BTAR

Backup to another region (BTAR) is a disaster recovery feature that allows backup
files to be copied from the service's primary backup region to an additional (secondary)
region. BTAR can bolster data resilience and helps improve data protection against
Expand Down Expand Up @@ -79,10 +77,10 @@ flowchart LR
- BTAR is supported for Aiven for MySQL®, Aiven for PostgreSQL®, and Aiven for OpenSearch®.
- The cloud provider for your additional backup region must match the cloud provider for
your service and the primary backup.
<!-- - To
- To
[restore your service from an additional backup](/docs/platform/howto/btar/manage-backup-to-another-region)
using point-in-time recovery (PITR), set up the time to no later than the time of the
latest backup.-->
latest backup.
- Secondary backup can only be restored in the region where it was stored.
- Secondary backup is generated only after a primary backup is complete, and there might
be a data replication lag between the primary region and the secondary region.
Expand Down
152 changes: 102 additions & 50 deletions docs/platform/howto/btar/enable-backup-to-another-region.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ sidebar_label: Add cross-region backup
limited: true
---

import ConsoleLabel from "@site/src/components/non-swizzled/ConsoleIcons"
import RelatedPages from "@site/src/components/non-swizzled/RelatedPages"
import CreateService from "@site/static/includes/create-service-console.md";
import ConsoleLabel from "@site/src/components/non-swizzled/ConsoleIcons";
import RelatedPages from "@site/src/components/non-swizzled/RelatedPages";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Enable [the backup to another region (BTAR) feature](/docs/platform/concepts/backup-to-another-region) and create an additional cross-region service backup on top of a regular backup stored in the region where your service is hosted.

:::important
BTAR is supported for Aiven for MySQL®, Aiven for PostgreSQL®, and Aiven for OpenSearch®.
:::

To add an additional service backup for your service, you can use the Aiven
[Console](#enable-btar-console), [CLI](#enable-btar-cli), or [API](#enable-btar-api).
To add an additional service backup for your service, you can use the Aiven Console, CLI,
or API.

## Prerequisites

Expand All @@ -27,17 +30,20 @@ To add an additional service backup for your service, you can use the Aiven
- [Aiven CLI client](/docs/tools/cli)
- [cURL](https://curl.se/download.html) CLI tool

## Back up to another region via console {#enable-btar-console}
## Add a cross-region backup to an existing service

1. Log in to the [Aiven Console](https://console.aiven.io/).
1. From the <ConsoleLabel name="serviceusers"/> view, select an Aiven service on
which you'd like to enable BTAR.
1. On your service's page, click <ConsoleLabel name="backups"/> from the sidebar.
<Tabs groupId="group1">
<TabItem value="gui" label="Aiven Console" default>
1. Log in to the [Aiven Console](https://console.aiven.io/) and go to your project page.
1. From <ConsoleLabel name="Services"/>, select an Aiven service on which you'd like to
enable BTAR.
1. On your service's page, click <ConsoleLabel name="backups"/> in the sidebar.
1. On the **Backups** page, click <ConsoleLabel name="actions"/> >
**Secondary backup location**.
1. In the **Secondary backup location** window, use the **Secondary location** menu to
**Add secondary backup location**.
1. In the **Add secondary backup location** window, toggle the
**Secondary backup location enabled** switch and use the **Backup location** menu to
choose a region for your additional backup.
1. Click **Enable** to confirm your selection.
1. Click **Save** to confirm your selection.

:::tip
For names of the cloud regions supported in Aiven, see column *Cloud* in
Expand All @@ -46,9 +52,88 @@ To add an additional service backup for your service, you can use the Aiven

Your new additional backup is now visible on your service's **Backups** page in the
**Secondary backup location** column.
</TabItem>
<TabItem value="cli" label="Aiven CLI">
Using the [Aiven CLI client](/docs/tools/cli), you can enable BTAR for

- [New Aiven service](#new-service-cli) or
- [Existing Aiven service](#existing-service-cli)

:::note[additional_backup_regions]
To enable BTAR on an Aiven service, add the `additional_backup_regions`
parameter to relevant commands.
:::

Use the [avn service update](/docs/tools/cli/service-cli) command to configure your
service so that it supports BTAR. Include `additional_backup_regions` as a parameter to
the command and set its value to the name of desired cloud region.

```bash
avn service update name_of_existing_service \
-c additional_backup_regions=[\"name_of_cloud_region\"]
```
</TabItem>
<TabItem value="api" label="Aiven API">
Using [Aiven APIs](/docs/tools/api), you can enable BTAR for:

- [New Aiven service](#new-service-api) or
- [Existing Aiven service](#existing-service-api)

:::note[additional_backup_regions]
To enable BTAR on an Aiven service, include the `additional_backup_regions`
parameter in relevant calls.
:::

Use the [ServiceUpdate](https://api.aiven.io/doc/#tag/Service/operation/ServiceUpdate) API
to configure your existing service so that it supports BTAR. When constructing the API
request, add the `user_config` object to the request body and nest the
`additional_backup_regions` field inside. Set the value of the
`additional_backup_regions` parameter to the name of desired cloud region.

```bash
curl --request PUT \
--url https://api.aiven.io/v1/project/YOUR_PROJECT_NAME/service/YOUR_SERVICE_NAME \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data
'{
"user_config": {
"additional_backup_regions": ["cloud-region-name"]
}
}'
```

</TabItem>
</Tabs>

## Back up to another region with CLI {#enable-btar-cli}
## Add a cross-region backup to a new service

<Tabs groupId="group1">
<TabItem value="gui" label="Aiven Console" default>

#### 1. Create a service

<CreateService/>

#### 2. Add a backup for the new service

1. On your service's page, click <ConsoleLabel name="backups"/> in the sidebar.
1. On the **Backups** page, click <ConsoleLabel name="actions"/> >
**Add secondary backup location**.
1. In the **Add secondary backup location** window, toggle the
**Secondary backup location enabled** switch and use the **Backup location** menu to
choose a region for your additional backup.
1. Click **Save** to confirm your selection.

:::tip
For names of the cloud regions supported in Aiven, see column *Cloud* in
[List of available cloud regions](/docs/platform/reference/list_of_clouds).
:::

Your new additional backup is now visible on your service's **Backups** page in the
**Secondary backup location** column.
</TabItem>
<TabItem value="cli" label="Aiven CLI">
Using the [Aiven CLI client](/docs/tools/cli), you can enable BTAR for

- [New Aiven service](#new-service-cli) or
Expand All @@ -59,8 +144,6 @@ To enable BTAR on an Aiven service, add the `additional_backup_regions`
parameter to relevant commands.
:::

### Create a service with BTAR via CLI {#new-service-cli}

Use the [avn service create](/docs/tools/cli/service-cli) command to create a
service. Include `additional_backup_regions` as a parameter to the command and set its
value to the name of the desired cloud region.
Expand All @@ -74,19 +157,8 @@ avn service create \
new_service_name
```

### Enable BTAR on an existing service via CLI {#existing-service-cli}

Use the [avn service update](/docs/tools/cli/service-cli) command to configure your
service so that it supports BTAR. Include `additional_backup_regions` as a parameter to
the command and set its value to the name of desired cloud region.

```bash
avn service update name_of_existing_service \
-c additional_backup_regions=[\"name_of_cloud_region\"]
```

## Back up to another region with API {#enable-btar-api}

</TabItem>
<TabItem value="api" label="Aiven API">
Using [Aiven APIs](/docs/tools/api), you can enable BTAR for:

- [New Aiven service](#new-service-api) or
Expand All @@ -97,8 +169,6 @@ To enable BTAR on an Aiven service, include the `additional_backup_regions`
parameter in relevant calls.
:::

### Create a service with BTAR via API {#new-service-api}

Use the [ServiceCreate](https://api.aiven.io/doc/#tag/Service/operation/ServiceCreate) API
to create a service with BTAR enabled. When constructing the API request, add the
`user_config` object to the request body and nest the `additional_backup_regions`
Expand All @@ -121,26 +191,8 @@ curl --request POST \
}'
```

### Enable BTAR on an existing service via API {#existing-service-api}

Use the [ServiceUpdate](https://api.aiven.io/doc/#tag/Service/operation/ServiceUpdate) API
to configure your existing service so that it supports BTAR. When constructing the API
request, add the `user_config` object to the request body and nest the
`additional_backup_regions` field inside. Set the value of the
`additional_backup_regions` parameter to the name of desired cloud region.

```bash
curl --request PUT \
--url https://api.aiven.io/v1/project/YOUR_PROJECT_NAME/service/YOUR_SERVICE_NAME \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data
'{
"user_config": {
"additional_backup_regions": ["cloud-region-name"]
}
}'
```
</TabItem>
</Tabs>

<RelatedPages/>

Expand Down

0 comments on commit cc1177c

Please sign in to comment.