During disaster recovery (DR) for Oracle Analytics Cloud (OAC), you need to migrate content from the primary OAC instance to the DR OAC instance across Oracle Cloud Infrastructure (OCI) regions. You can use REST APIs to migrate OAC content in snapshots and the Data Migration utility to migrate data files across OCI regions.
OAuth tokens from Oracle Identity Cloud Services (IDCS) or IAM Identity Domains are the authentication method used to authenticate OAC REST APIs.
You use a confidential application to generate the OAuth tokens and multiple grant types such as resource owner, refresh tokens, JWT assertion, and device code in IDCS or IAM Identity Domain. For information on how to use multiple grant types in confidential applications, read the blog Unlocking Oracle Analytics Cloud with OAuth 2.0.
This article describes how to run the REST APIs and Data Migration utility commands to store the snapshot and data files in OCI object storage.
You can use the automation scripts provided in this article to migrate content from a primary OAC instance to a DR OAC instance for Disaster Recovery configuration. For download details, see:
- BI Service Administrator Username and Password
- Install JDK 1.8.0+ latest version
- Download OAC Data Migration Utility
Here are the steps required to migrate OAC content and data files using the automation scripts:
- Create a confidential application for each source and target OAC instance
- Configure an OCI object storage bucket for each source and target OAC instance
- Use the confidential application details to get the refresh token
- Use the refresh token to generate OAuth token
- Use the OAuth token to connect the OAC instances using REST APIs
- Create a snapshot on the source OAC instance using the automation scripts
- Download the snapshot and the data files from the source OAC instance
- Zip the snapshot and the data files and upload the files to the OCI object storage bucket
- Register the snapshot and restore the snapshot and data files to the target OAC instance
Attributes Required to Run the OAC REST API Commands
For information on how to create a confidential application, refer to the blog Create a Confidential Application for OAuth Client in Oracle Identity Cloud Service.
To run the OAC REST API commands, you must provide the following attributes from the OAuth client:
- ClientId — The OAuth client ID used to access the IDCS identity store.
- ClientSecret — The OAuth Client Secret (password) used to generate access tokens.
- Scope — Scope of the confidential application.
- IDCS URL — The IDCS or IAM Domain URL to get a token.
Prerequisites to Create Object Storage Buckets
Add the required policies to the compartment where you plan to store and manage snapshots. You can create a compartment or use an existing compartment. Since the compartment is not regional, create the policies for the compartment in the tenancy.
- Log in to the OCI Console.
- Navigate to Identity & Security > Policies > Select the Compartment > Create Policy.
- Add the following policies:
- Allow group Administrators to manage objects in compartment <compartment name>
- Allow group Administrators to manage buckets in compartment <compartment name>
- Allow service objectstorage-us-ashburn-1 to manage object-family in compartment <compartment name>
- Allow service objectstorage-us-phoenix-1 to manage object-family in compartment <compartment name>
Ensure that JDK 1.8.0_361+ and the Data Migration utility are available on the Linux machine where the automation scripts will run.
Download the scripts:
- createSnapshot.sh: Creates a snapshot backup and data files backup and stores in OCI object storage as a zip file.
- registerSnapshot.sh: Register script downloads the backup zip file, registers the snapshot, and restores it with the data files at the target OAC instance.
These scripts have plain-text values of usernames and passwords as input values for some variables. To avoid plain-text values of sensitive data and use encrypted values in the scripts, use Oracle Cloud vaults and secrets.
See the blog Using encrypted values from Oracle Cloud Vaults and Secrets in the Oracle Analytics Cloud migration automation for more details and customize the scripts shared in this blog post.
For more details, download the whitepaper Automate Oracle Analytics Cloud snapshot and data file migration using REST APIs:
Call to Action
You have now generated OAuth tokens and run the OAC snapshot, data files backup, and restore scripts to automate the OAC migration using the REST APIs.
During content replication across OCI regions, the snapshot created in the home region OAC instance doesn't migrate data files to the DR region OAC instance. Use the Data Migration utility and migrate data files across OCI regions. For more information, see Migrate File-based Data.