Add a backup to another region Limited availability
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.
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, CLI, or API. You can enable BTAR for
Prerequisites
-
This feature is in limited availability. Enable it by contacting your account 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:
Add a cross-region backup to an existing service
- Aiven Console
- Aiven CLI
- Aiven API
-
Log in to the Aiven Console and go to your project page.
-
From Services, select an Aiven service on which you'd like to enable BTAR.
-
On your service's page, click Backups in the sidebar.
-
On the Backups page, click Actions > Add secondary backup location.
-
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.
-
Click Save to confirm your selection.
tipFor 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.
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\"]
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"]
}
}'
Add a cross-region backup to a new service
- Aiven Console
- Aiven CLI
- Aiven API
Step 1: Create a service
-
From your project, in the Services page, click Create service.
-
From the Select service page, click the service type of your choice.
-
Select the cloud provider and region to host your service on.
noteThe pricing for the same service can vary between different providers and regions. The service summary shows you the pricing for your selected options.
-
Select a service plan.
noteThis determines the number of servers and the memory, CPU, and disk resources allocated to your service. See Plans & Pricing.
-
Optional: Add disk storage.
-
Enter a name for your service.
importantYou cannot change the name after you create the service.
You can fork the service with a new name instead.
-
Optional: Add tags.
-
Click Create service.
The Overview page of the service opens. It shows the connection parameters for your service, its current status, and the configuration options.
The status of the service is Rebuilding during its creation. When the status becomes Running, you can start using the service. This typically takes couple of minutes and can vary between cloud providers and regions.
Step 2: Add a backup for the new service
-
On your service's page, click Backups in the sidebar.
-
On the Backups page, click Actions > Add secondary backup location.
-
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.
-
Click Save to confirm your selection.
tipFor 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.
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 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"]
}
}'
Related pages