Migrate to managed disaster recovery
This page describes how to migrate from BigQuery cross-regionreplication to BigQuery managed disaster recovery.
Overview
BigQuerycross-regionreplication (CRR) and manageddisasterrecovery (DR) are both features designed toenhance data availability and disaster recovery capabilities. However, theyhandle regional outages in different ways. CRR doesn't allow promoting thesecondary replica if the primary region is unavailable. In contrast, DR offersmore comprehensive protection by allowing a failover to the secondary replicaeven if the primary region is unavailable. With CRR, only storage is replicated,while with DR both storage and compute capacity are replicated.
The following table describes the feature capabilities of CRR and DR:
| Feature | CRR | DR |
|---|---|---|
| Initial replication process | Uses CRR to replicate the dataset initially. | The initial load is previously replicated with CRR before migrating a CRR dataset to a DR dataset. |
| Promotion replication | Uses standard replication. | UsesTurbo replication. |
| Promotion process | Promotes at the dataset level. | Promotes at the reservation level (reservation failover and dataset promotion). Many datasets can be attached to one failover reservation. Dataset level promotion is unavailable with DR. |
| Promotion execution | Through UI or SQL based DDL command for each dataset. There is no support for CLI, Client Libraries, API, or Terraform. | Through UI or SQL based DDL command for each EPE reservation. There is no support for CLI, client libraries, API, or Terraform. |
| Failover mode | Soft failover. | Hard failover. |
| Edition requirement | Any capacity model. | Enterprise Plus edition. |
| Limitations | CRR limitations. | Includes bothCRR limitations andDR limitations. |
| Write access | Jobs running under any capacity model can write to replicated datasets in the primary region. Secondary is always read-only. | Only the jobs running under Enterprise Plus reservations can write to replicated datasets in the primary region. Secondary dataset and reservation replicas are always read-only. |
| Read access | Jobs running under any capacity model can read from replicated datasets. | Jobs running under any capacity model can read from replicated datasets. |
Migration implications
The following sections provide an overview of the cost and capability changesthat occur when you migrate to DR.
Cost implications
Consider the following cost implications when you migrate from CRR to DR:
DR only supports write access from the Enterprise Plus edition, whichincurs higher compute costs. You can read from any capacity model, so read costsfor existing jobs don't change.
DR usesTurboreplication, whichincurs additional costs depending on the region pair.
Storage prices are the same for both CRR and DR.
For more information about pricing, seePricing.
Capability implications
Consider the following capability implications when you migrate from CRR to DR:
DR only supports failover at the reservation level. Any existing jobs thatrely on dataset-level failover fail.
Only Enterprise Plus edition queries can write to the dataset once itis attached to the DR reservation. Any existing write jobs that don't use anEnterprise Plus edition for their compute capacity fail.
Before you begin
Before you begin the migration, familiarize yourself with the concepts incross-region replication and manageddisaster recovery.
To migrate to DR, you must have the following prerequisites:
You have an active Google Cloud project with BigQuery enabled.
You have created and replicated datasets with CRR.
The datasets have the same primary and secondary locations you want to use forDR.
You have the necessary permissions to work with DR. For more information aboutpermissions, seeBefore youbegin.
Migrate from CRR to DR
The following sections describe how to migrate your datasets from CRR to DR. Itassumes you have already configured your datasets for CRR.
Create a failover reservation
To enable disaster recovery, you must create a failover reservation in theprimary region. Configure your reservation with the appropriate primary andsecondary region. The primary and secondary regions should match the regions ofall the CRR datasets you intend to migrate to DR. To create a failoverreservation, choose one of the following options:
Console
In the Google Cloud console, go to theBigQuery page.
In the navigation menu, clickCapacity management, andthen clickCreate reservation.
In theReservation name field, enter a name for the reservation.
In theLocation list, select the location.
In theEdition list, select the Enterprise Plus edition.
In theMax reservation size selector list, select the maximum reservation size.
Optional: In theBaseline slots field, enter the number of baselineslots for the reservation.
The number of available autoscaling slots is determined bysubtracting theBaseline slots value from theMax reservationsize value. For example, if you create a reservation with 100 baselineslots and a max reservation size of 400, your reservation has 300autoscaling slots. For more information about baseline slots, seeUsing reservations with baseline and autoscalingslots.
In theSecondary location list, select the secondary location.
To disableidle slot sharingand use only the specified slot capacity, click theIgnore idle slotstoggle.
To expand theAdvanced settings section, click theexpander arrow.
Optional: To set the target job concurrency, click theOverrideautomatic target job concurrency toggle to on, and then enter a value forTargetJob Concurrency.The breakdown of slots is displayed in theCost estimate table. Asummary of the reservation is displayed in theCapacity summarytable.
ClickSave.
The new reservation is visible in theSlot reservations tab.
SQL
To create a reservation, use theCREATE RESERVATION data definition language (DDL) statement.
In the Google Cloud console, go to theBigQuery page.
In the query editor, enter the following statement:
CREATERESERVATION`ADMIN_PROJECT_ID.region-LOCATION.RESERVATION_NAME`OPTIONS(slot_capacity=NUMBER_OF_BASELINE_SLOTS,edition=ENTERPRISE_PLUS,secondary_location=SECONDARY_LOCATION);
Replace the following:
ADMIN_PROJECT_ID: the project ID of theadministration project that owns the reservation resource.LOCATION: thelocation of the reservation. If you select aBigQuery Omni location, your edition option is limited to the Enterprise edition.RESERVATION_NAME: the name of the reservation.The name must start and end with a lowercase letter or a number and contain only lowercase letters, numbers, and dashes.
NUMBER_OF_BASELINE_SLOTS: the number of baseline slots to allocate to the reservation. You cannot set theslot_capacityoption and theeditionoption in the same reservation.SECONDARY_LOCATION: the secondarylocation of the reservation. In the case of an outage, any datasets attached to this reservation will fail over to this location.
ClickRun.
For more information about how to run queries, seeRun an interactive query.
Attach the dataset to the reservation
Once you've created the failover reservation, attach your cross-region dataset, or datasets, to the reservation. This enables failover for all of the attached datasets. To attach the dataset to the reservation, choose one of the following options:
Console
In the Google Cloud console, go to theBigQuery page.
In the navigation menu, clickCapacity management, and thenclick theSlot Reservations tab.
Click the reservation that you want to attach a dataset to.
Click theDisaster recovery tab.
ClickAdd failover dataset.
Enter the name of the dataset you want to associate with the reservation.
ClickAdd.
SQL
To attach a dataset to a reservation, use theALTER SCHEMA SET OPTIONS DDL statement.
In the Google Cloud console, go to theBigQuery page.
In the query editor, enter the following statement:
ALTERSCHEMA`DATASET_NAME`SETOPTIONS(failover_reservation=ADMIN_PROJECT_ID.RESERVATION_NAME);
Replace the following:
DATASET_NAME: the name of the dataset.ADMIN_PROJECT_ID.RESERVATION_NAME: the name of the reservation you want to associate the dataset to.
ClickRun.
For more information about how to run queries, seeRun an interactive query.
Verify the configuration
To verify the status of your configuration, query theINFORMATION_SCHEMA.SCHEMATA_REPLICASview.
PROJECT_ID.`region-REGION`.INFORMATION_SCHEMA.SCHEMATA_REPLICAS[_BY_PROJECT]Verify that the datasets are attached to the correct reservation in the correctregions.
Replace the following:- Optional:
PROJECT_ID: the ID of your Google Cloud project. If not specified, the default project is used. REGION: anydataset region name. For example,`region-us`.Note: You must usea region qualifier to query
INFORMATION_SCHEMAviews. The location of the query execution must match the region of theINFORMATION_SCHEMAview.
Examples
The following example walks you through the steps to migrate from CRR to DR withpractical examples using GoogleSQL. For this example, assume thefollowing:
You are working in a project named
myproject.You have already created a dataset named
mydatasetand configured it withCRR.The primary region of
mydatasetisus-central1and the secondary region isus-west1.
To begin migrating your dataset to DR, first create a reservation with theEnterprise Plus edition. In this example, the name of the reservationismyreservation.
CREATERESERVATION`myproject.region-us-central1.myreservation`OPTIONS(slot_capacity=0,edition=ENTERPRISE_PLUS,autoscale_max_slots=50,secondary_location='us-west-1');Once the reservation is created, you can then attach the dataset to thereservation. The following example attaches the dataset to the reservation:
ALTERSCHEMA`myproject.mydataset`SETOPTIONS(failover_reservation='myproject.myreservation');Then, verify that the dataset has been successfully attached.
SELECTfailover_reservation_project_id,failover_reservation_name,FROM`myproject`.`region-us-west1`.INFORMATION_SCHEMA.SCHEMATA_REPLICASWHEREschema_name='mydataset';The results of this query should look similar to the following:
+---------------------------------+---------------------------+| failover_reservation_project_id | failover_reservation_name |+---------------------------------+---------------------------+| myproject | myreservation || myproject | myreservation |+---------------------------------+---------------------------+
What's next?
For more information about cross-region replication, seeCross-region datasetreplication.
For more information about managed disaster recovery, seeManaged disasterrecovery.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.