title | sidebar_label |
---|---|
Add a backup to another region |
Add cross-region backup |
Enable the backup to another region (BTAR) feature 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® and Aiven for PostgreSQL®. :::
To add an additional service backup for your service, you can use the Aiven Console, CLI, or API.
-
Enable BTAR for your organization by contacting the sales team.
-
Make sure you have at least one running Aiven for MySQL® or Aiven for PostgreSQL® service.
-
Depending on your preferred tool to manage BTAR with, make sure you can access or use:
- Aiven Console
- Aiven CLI client
- cURL CLI tool
-
Log in to the Aiven Console.
-
From the Services view, select an Aiven service on which you'd like to enable BTAR.
-
On your service's page, select Backups from the sidebar.
-
On the Backups page, select the actions (...) menu > Secondary backup location.
-
In the Secondary backup location window, use the Secondary location menu to select a region for your additional backup. Confirm your choice by selecting Enable.
:::tip For names of the cloud regions supported in Aiven, see column Cloud in List of available cloud regions. :::
Your new additional backup is now visible on your service's Backups page in the Secondary backup location column.
Using the Aiven CLI client, you can enable BTAR for
:::note[additional_backup_regions]
To enable BTAR on an Aiven service, add the additional_backup_regions
parameter to relevant commands.
:::
Use the avn service create 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.
avn service create \
--service-type service_type_name \
--cloud cloud_region_name \
--plan service_plan_name \
-c additional_backup_regions=\[\"name_of_cloud_region\"\] \
new_service_name
Use the avn service update 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.
avn service update name_of_existing_service \
-c additional_backup_regions=[\"name_of_cloud_region\"]
Using Aiven APIs, you can enable BTAR for:
:::note[additional_backup_regions]
To enable BTAR on an Aiven service, include the additional_backup_regions
parameter in relevant calls.
:::
Use the 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
field inside.
curl --request POST \
--url https://api.aiven.io/v1/project/YOUR_PROJECT_NAME/service \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data
'{
"cloud": "string",
"plan": "string",
"service_name": "service_2_name",
"service_type": "cassandra",
"user_config": {
"additional_backup_regions": ["cloud-region-name"]
}
}'
Use the 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.
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"]
}
}'