Restore a Service Instance

You can restore an Oracle Java Cloud Service instance from a backup using the REST API. The following procedure describes how to undo configuration changes for an existing service instance by using a backup to return the instance to a particular state.

Note:

  • On accounts that are integrated with Oracle Identity Cloud Service, the identity domain ID is the Identity Cloud Service tenant name. This tenant name begins with the characters idcs-followed by a string of number and letters (for example, idcs-98888f7964454b658ac6d2f625b29030). Access the Oracle Identity Cloud Service Console in a browser to find the tenant name in the URL. You can also find the name when you sign in to your Oracle Cloud account, navigate to Identity and then select Federation.

  • The cURL command examples use the URL structure https://rest_server_url/resource-path, where rest_server_url is the REST server to contact for your identity domain. See Send Requests.

When you restore from a backup, you can also choose to reset the Oracle WebLogic Server and the JDK software to the versions that correspond to the official patch set update (PSU) level of the software that Oracle Java Cloud Service is currently running, or leave the versions unchanged.

Consider the following before you use a backup to restore an Oracle Java Cloud Service instance:

  • If you performed a scaling operation after the backup was created, the topology of the service instance and the topology of the backup might not be the same. The restore operation can automatically remove nodes that you added to the service instance after the backup was created. However, the restore operation cannot add missing nodes to the service instance that were removed after the backup was created.

  • If a database backup was included in the Oracle Java Cloud Service instance backup, note that restoration of the database files for the database deployment associated with the Oracle Java Cloud Service instance is not supported through the Oracle Java Cloud Service instance restore operation. You need to restore the database files separately. Depending on whether the database deployment is hosting a single-instance database or an Oracle Real Application Clusters (Oracle RAC) database, you use an RMAN tag or a timestamp of the associated database backup to restore the database files. The RMAN tag or timestamp is the dbTag value that is returned when you perform a GET request on the Oracle Java Cloud Service instance backup, as described in View a Backup. For example, to restore the database files for a Database Cloud Service database deployment, see Restoring from a Specific Backup or Restoring to a Specific Point in Time in Administering Oracle Database Cloud Service.

  • If the backup was retired because the database schema password was changed after the backup was taken, you must provide the current schema password.

  • See About Backup and Restoration in Administering Oracle Java Cloud Service.

To restore an Oracle Java Cloud Service instance from a backup:

  1. Before restoring from a backup, review the backups that are currently defined to retrieve the ID of the backup from which you want to restore.
    curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/backups
    

    Specify the following options on the cURL command line:

    • -i option to include the HTTP header in the output. This option is optional.

    • -X option to indicate the type of request (GET).

    • -u option to specify the user name and password for the Oracle Java Cloud Service account for authentication.

    • -H to define a custom header, X-ID-TENANT-NAME, to identify the identity domain ID.

    The following example shows the response in JSON format. There is one completed backup.

    {
        "backups":[
        {
            "backupId":"1449332100032",
            "jobId":"8191",
            "backupStartDate":"Sat Dec 05 16:15:01 GMT 2015",
            "backupCompleteDate":"Sat Dec 05 17:36:18 GMT 2015",
            "expirationDate":"Mon Jan 04 16:15:00 GMT 2016",
            "initiatedBy":"scheduled",
            "full":true,
            "local":false,
            "localCopy":true,
            "databaseIncluded":true,
            "size":"15.8MB",
            "sizeInBytes":16557866,
            "dbTag":"TAG20151205T163004",
            "status":"Completed",
            "href":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/ExampleInstance\/backups\/1449332100032",
            "serviceComponents":[
            {
                "type":"JDK",
                "version":"1.7.0_xx"
            },
            {
                "type":"OTD",
                "version":"11.1.1.9.x"
            },
            {
                "type":"WLS",
                "version":"12.1.3.0.x"
            },
            {
                "type":"OTD_JDK",
                "version":"1.7.0_xx"
            }],
            "notes":"Automated backup"
        }]
    }

    For more information, see View All Backups.

  2. Create a JSON document, restore.json, that defines the backup ID from which to restore.

    Using the example shown earlier, the backup ID is:

    {
        "backupId":"1449332100032"
    }

    If the backup was retired because the database schema password was changed after the backup was taken, you must also provide the current schema password, as shown next:

    {
        "backupId":"1449332100032"
        "schemaPassword": "password"
    }
  3. Restore the Oracle Java Cloud Service instance from a backup, passing the JSON document created in step 2.
    curl -i -X POST -u username:password -d @restore.json -H "Content-Type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/restoredbackups
    

    Specify the following options on the cURL command line:

    • -i option to include the HTTP header in the output. This option is optional.

    • -X option to indicate the type of request (POST).

    • -u option to specify the user name and password for the Oracle Java Cloud Service account for authentication.

    • -d option to identify the request document, in JSON format, on the local machine (restore.json).

    • -H to identify the content type as application/json and define a custom header, X-ID-TENANT-NAME, to identify the identity domain ID.

    Note: You cannot restore from an existing backup when the backup service for the specified service instance is in a DISABLED state.

    For more information, see Restore a Service Instance.

    The following shows an example of the response in JSON format.

    {
        "operationName":"restore-backup",
        "job_id":"8227",
        "target_uri":"https:\/\/rest_server_url/\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/ExampleInstance\/restoredbackups\/8227"
    } 
  4. View detailed information about the restoration operation using the restoration operation status URI (target_uri) returned in the response body in step 3.
    curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/restoredbackups/8227
    

    Specify the following options on the cURL command line:

    • -i option to include the HTTP header in the output. This option is optional.

    • -X option to indicate the type of request (POST).

    • -u option to specify the user name and password for the Oracle Java Cloud Service account for authentication.

    • -H to define a custom header, X-ID-TENANT-NAME, to identify the identity domain ID.

    For more information, see View the Status of a Restoration Operation.

    The following shows an example of the response body in JSON format:

    {
        "backupId":"1449332100032",
        "backupStartDate":"Sat Dec 05 16:15:00 GMT 2015",
        "jobId":"8227",
        "recoveryStartDate":"Thu Dec 10 23:11:55 GMT 2015",
        "recoveryCompleteDate":"Thu Dec 10 23:24:26 GMT 2015"
        "status":"Completed",
        "statusDetails":"Downloading the backup archive from the Oracle Storage Cloud Service container...The backup archive already exists in the block storage and does not need to be downloaded from the Oracle Storage Cloud Service container...
           Submitted the restoration precheck for remote execution...Restoration precheck passed...Submitted the restoration for remote execution...
           Stopping WebLogic Server...Stopped WebLogic Server...Restoring the configuration data for WebLogic Server administration server on host exampleinstance-wls-1...
           Restored the configuration data for WebLogic Server administration server on host exampleinstance-wls-1...Restoring Oracle Traffic Director on host exampleinstance-lb-1...
           Restored Oracle Traffic Director on host exampleinstance-lb-1...Restoring the configuration data for WebLogic Server administration server on host exampleinstance-wls-2...
           Restored the configuration data for WebLogic Server administration server on host exampleinstance-wls-2...
           Starting WebLogic Server...Started WebLogic Server...Unlocked the WebLogic Server domain configuration...
           Completed the restoration...Validated the load balancer",
        "staticDataIncluded":false,
        "configDataIncluded":true,
        "otdIncluded":true,
        "databaseIncluded":false
    }