Skip to main content

Back up your Aiven for Valkey™ service to another region

Copy your Aiven for Valkey™ service backups to a secondary region for disaster recovery.

In addition to the primary service backup, you can have a secondary backup in an alternative location.

important

This feature is in limited availability. Contact your account team to enable it.

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 disasters in the primary backup region. When the primary region is down, BTAR allows forking the service from an additional copy of the backup residing in a secondary region.

Limitations

  • The cloud provider for your additional backup region must match the cloud provider for your service and the primary backup.
  • Secondary backup can only be restored in the region where it was stored.

For a service that has the backup to another region (BTAR) feature enabled, you can check the service backup status, change the backup region, monitor the replication lag, fork and restore using the cross-region backup, or migrate to another cloud or region.

Prerequisites

Change a backup region

  1. Log in to the Aiven Console and go to your project.
  2. On the Services page, select an Aiven service on which you'd like to enable BTAR.
  3. On your service page, click Backups in the sidebar.
  4. On the Backups page, click Actions > Edit secondary backup location.
  5. In the Edit secondary backup location window, use the Backup location menu to select a region for your additional backup. Confirm your choice by selecting Save.
important

You can change the backup region once in 24 hours.

Monitor a service with BTAR

There are a few things you may want to check for your Aiven service in the context of BTAR:

  • What is the status of a secondary backup?

    • Does your service have a backup in another region?
    • What is the target region of the secondary backup?
  • What is the replication lag between data availability in the primary region and the secondary region?

Check BTAR status

To see the availability, the status, and the target region of a secondary (BTAR) backup in the Aiven Console, go to your service page > Backups > Secondary backup location.

Determine replication lag

Determine the target region and the replication lag for a secondary (BTAR) backup of your service, call the ServiceBackupToAnotherRegionReport endpoint.

Configure the call as follows:

  1. Enter YOUR-PROJECT-NAME and YOUR-SERVICE-NAME into the URL.
  2. Specify DESIRED-TIME-PERIOD depending on the time period you need the metrics for: select one of the following values for the period key: hour, day, week, month, or year.
curl --request POST                                                                                                     \
--url https://api.aiven.io/v1/project/YOUR-PROJECT-NAME/service/YOUR-SERVICE-NAME/backup_to_another_region/report \
--header 'Authorization: Bearer YOUR-BEARER-TOKEN' \
--header 'content-type: application/json' \
--data '{"period":"DESIRED-TIME-PERIOD"}'

As output, you get metrics including replication lags at specific points in time.

Fork and restore a service with BTAR

You can use the Aiven Console, API, or CLI to recover your service from a backup in another region. To restore your service using BTAR, create a fork of the original service in the region where the secondary backup resides.

note

When you fork & restore from the secondary backup, your new fork service is created in the cloud and region where the secondary backup is located. The fork service gets the same plan that the primary service uses. Backups of the fork service are located in the region where this new service is hosted.

  1. Open the Aiven Console and go to your service homepage.

  2. Click Backups in the sidebar.

  3. On the Backups page, select Fork & restore.

  4. In the New database fork window:

    1. Set Backup location to either Primary location or Secondary location.

    2. Set Backup version to one of the following:

      • Latest transaction
      • Point in time: Set it up to no earlier than the time of taking the oldest replicated base backup.
    3. Specify a name for the new fork service.

    4. Select Create fork.

Migrate a service with BTAR

You can migrate a service with BTAR the same way you migrate a service with a regular backup.

note

When you migrate your service, locations of service backups, both primary and secondary ones, do not change.

Delete a cross-region backup

Delete an additional service backup created in a region different from your primary backup region.

You can delete a cross-region backup using the Aiven Console, API, or CLI. When you delete the additional cross-region backup, you still have the default backup located in the primary, service-hosting region.

  1. Log in to the Aiven Console.
  2. From the Services view, select an Aiven service on which you'd like to disable BTAR.
  3. On your service's page, select Backups from the sidebar.
  4. On the Backups page, click Actions > Secondary backup location.
  5. In the Edit secondary backup location window, select Disable.

Your additional service backup is no longer visible on your service's Backups page in the Secondary backup location column.

Related pages