Skip to main content

Back up your Aiven for OpenSearch® service to another region

Copy your Aiven for OpenSearch® service backups to a secondary region for disaster recovery.

In addition to the primary service backup, you can keep a secondary backup in another region.

Backup to another region (BTAR) is a disaster recovery feature that copies backup files from your service's primary backup region to an additional, secondary region. BTAR improves data resilience and protects your data against an outage in the primary backup region. If the primary region becomes unavailable, you can fork your service from the backup copy stored in the secondary region.

BTAR is not a live replica of your database. It replicates backup files asynchronously, so recovery means forking or restoring from those files rather than failing over to a running standby. For a live standby with managed failover, use cross-region disaster recovery on Aiven for PostgreSQL® instead.

Charges​

BTAR is charged based on your usage, with no flat fee. Charges cover the following:

  • Secondary backup storage: Aiven charges for each GB-month of backup data stored in the secondary region, based on the logical size of each retained backup. Each retained backup is charged separately, so a longer backup retention increases the stored data you pay for. The rate depends on the secondary backup region.
  • Cross-region backup transfer: Aiven charges for the backup data copied from the primary region to the secondary region, for each GB. The rate depends on whether the two regions are on the same continent.

Secondary backup storage is charged for as long as the backups are retained in the secondary region, including while your service is powered off. Powering off a service stops backup transfer charges, because the service creates no new backups, but storage charges continue.

Restoring from a secondary backup adds no transfer charge, because the restore runs in the region where the backup is stored.

For bring your own cloud services, Aiven charges a flat monthly fee for each service with BTAR enabled. You pay your cloud provider directly for the storage and transfer.

Limitations​

  • The cloud provider for your secondary backup region must match the cloud provider for your service and its primary backup.
  • You can configure one secondary backup region for each service.
  • BTAR is available only on the Professional service tier. To change your service to a plan outside the Professional service tier, remove the secondary backup region first.
  • For bring your own cloud services, the secondary backup region must be one of your custom cloud regions.
  • You can restore a secondary backup only in the region where it is stored.
  • To fork from a secondary backup, the backup must already be replicated to the secondary region.
  • Read replicas cannot restore from a secondary backup.

With backup to another region (BTAR), you can add or change a secondary backup region, check the secondary backup status, monitor the replication lag, fork and restore using the cross-region backup, or migrate to another cloud or region.

BTAR is configured with the additional_backup_regions option in your service configuration. The option takes one region, which holds the secondary backup for your service.

Prerequisites​

Add a secondary backup region​

  1. Log in to the Aiven Console and go to your project.
  2. Go to Services, then select the Aiven service on which you'd like to enable BTAR.
  3. On your service page, in the Backups section, click Backup management.
  4. On the Backups page, click Actions > Add secondary backup location.
  5. In the Add secondary backup region window, turn on Secondary backup location enabled.
  6. Use the Backup location menu to select a region for your secondary backup.
  7. Review the Additional costs card with the rates for the selected region.
  8. Click Add backup region.

Aiven provisions storage in the region you selected and starts replicating backup files to it. Until the first backup finishes replicating, you cannot fork your service from the secondary backup.

Change a secondary backup region​

Repeat Add a secondary backup region and select a different region. In the Aiven Console, the action is called Edit secondary backup location once the service already has a secondary location. To apply the new region, click Save backup region.

important

Changing the secondary backup region starts a new base backup. You can fork your service from the new region only after that backup finishes.

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, 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​

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 and 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.

  3. On the Backups page, click Fork service.

  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. 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, in the Backups section, click Backup management.
  4. On the Backups page, click Actions > Edit secondary backup location.
  5. In the Edit secondary backup region window, turn off Secondary backup location enabled.
  6. Click Save.

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

Related pages