Back Up and Restore a Domain

Use the backup and restore capabilities of Oracle Cloud Infrastructure Block Volumes to return your Oracle WebLogic Server for OCI domain to a specific state, or to recover from a failure.

About Volume Backups

The backup feature of Oracle Cloud Infrastructure Block Volumes lets you make a point-in-time backup of data on a volume. You can create a new block volume from a backup, and then attach the new volume to a domain's compute instance.

Each Oracle WebLogic Server for OCI compute instance is comprised of three volumes:

  • Boot volume - This volume contains the Linux operating system. To restore a boot volume backup, you must create a new compute instance.

    Note:

    Restoring from a boot volume is not recommended. It must be performed only as a last option.
  • Block volume (Domain volume) - This volume has the contents of the /u01/data folder, including the domain configuration.
  • Block volume (Middleware volume) - This volume has the contents of the /u01/app folder. The Middleware volume is introduced in instances created after release 20.3.3 (September 29, 2020).

Oracle recommends that you create regular backups of all boot volumes and block volumes for your domain. You can create backups manually, or you can configure policies that automatically create backups based on a specific schedule, and retain the backups for a specific period of time.

The first backup of a volume is a full backup, which includes all changes since the volume was created. After the first backup, you can choose to create additional full backups, or to create incremental backups, which include only the changes since the last backup. Both backup types enable you to restore the full volume contents to the point-in-time snapshot of the volume when the backup was taken.

Backups are encrypted and stored in Oracle Cloud Infrastructure Object Storage. Therefore, backups can be restored as new volumes to any availability domain within the same region. You can also copy volume backups across regions for disaster recovery purposes.

You must restart WebLogic Server (or restart the entire compute instance) when you restore a block volume backup. To avoid downtime and ensure your applications remain available to users, Oracle recommends that you create a cluster with multiple compute instances, and that you restore the block volume for one compute instance at a time. This approach is also called a rolling recovery.

When you restore a block volume backup for the first compute instance, the domain's administration server will be temporarily unavailable. However, your applications do not depend on the administration server and will not be affected.

See Overview of Block Volume Backups in the Oracle Cloud Infrastructure documentation.

About Database Backups

If your Oracle WebLogic Server for OCI domain includes the Java Required Files (JRF) components, then Oracle recommends that you back up the database containing the JRF schemas.

When you restore the block storage volumes for a domain from a backup, then you can also restore the database from a backup that was taken at the same time.

The backup and restoration procedures vary depending on type of database: Oracle Autonomous Database or Oracle Cloud Infrastructure Database.

Database Type Details
Oracle Autonomous Database
Oracle Cloud Infrastructure Database

Create a Backup

Create a backup of all block volumes for your Oracle WebLogic Server for OCI domain.

You can either take an immediate backup of the volumes, or you can configure a backup policy that takes a future backup according to the policy's schedule.

Note:

Creating a new instance by restoring from a boot volume is not recommended. It must be preformed only as a last option. To backup a boot volume, see Backing Up a Volume.

To backup a block volume, complete the following steps:

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. Click the navigation menu Navigation Menu icon, select Compute. Under the Compute group, click Instances.
  3. Select the Compartment in which your domain was created.
  4. Click the name of the first compute instance for your domain.
    The instance has wls-0 appended to the name. For example: mydomain-wls-0
  5. Scroll down and under Resources, select Attached Block Volumes.
  6. Create a manual backup of the block volume, or assign it a backup policy.
  7. Repeat from step 2 through step 6 for the remaining compute instances in your domain.

Restore a Backup

Restore the volumes for your Oracle WebLogic Server for OCI domain from a backup.

There are two main scenarios where you would restore a backup:

Restore to a Previous Domain

If your domain configuration is corrupted, accidentally destroyed, or the domain is not behaving as expected after a change to the binaries, then you can restore the block volumes to a previous working backup.

Tip:

If you have a corrupted or missing domain, follow the restoration steps in this section using the data volume. Format: <my_domain_name>-data-block-node.

If you have patched or updated the WebLogic binaries and had unexpected results, follow the restoration steps in this section using the mw block volume. Format: <my_domain_name>-mw-block-node .

To avoid downtime, Oracle recommends that you restore the block volume for one compute instance in your domain at a time. The remaining compute instances can continue to process client requests.

When you attach a block volume to a virtual machine (VM) compute instance, you have two options for attachment type: iSCSI or paravirtualized. Paravirtualized attachments greatly simplify the process of configuring your block storage but IOPS performance is greater for iSCSI attachments. Bare metal compute instances must use iSCSI attachments. See Overview of Block Volume.

To restore a block volume, complete the following steps:

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. Click the navigation menu Navigation Menu icon, select Compute. Under the Compute group, click Instances.
  3. Select the Compartment in which your domain was created.
  4. Click the name of the first compute instance for your domain.
    The instance has wls-0 appended to the name. For example: mydomain-wls-0
  5. Click Attached Block Volumes.
  6. Identify the name of the block volume for this compute instance, and the Attachment Type: paravirtualized or iscsi.
  7. Create a new block volume from the backup. See Restoring a Backup to a New Volume.
    For example, mydomain-data-block-0-new for a domain volume or mydomain-mw-block-0-new for the binaries volume.
  8. Shut down the WebLogic Server processes on the compute instance if any are running.
    1. Connect to the compute instance as the opc user with a secure shell (SSH).
    2. Switch to the oracle user.
      sudo su - oracle
    3. Identify the process IDs of all server and Node Manager processes.
      ps -ef | grep weblogic.
      oracle <processID> ... weblogic.NodeManager
      oracle <processID> ... weblogic.Server
      oracle <processID> ... weblogic.Server
      
    4. Kill the Node Manager process ID, and then kill the server process IDs.
      kill -9 <processID>
  9. Detach the current block volume from the compute instance's file system.
    1. Connect to the compute instance as the opc user with SSH.
    2. Unmount /u01/data.
      sudo umount /u01/data
  10. Detach the current block volume from the compute instance. See Detaching a Volume.
    If the volume attachment type is iSCSI, then connect to the compute instance as the opc user with SSH, and follow the instructions in the Detach Block Volume dialog.
  11. Attach the new block volume to the compute instance. See Attaching a Volume.
    Select the same attachment type as the original block volume: paravirtualized or iSCSI.
  12. If the attachment type is iSCSI, then connect the new block volume to the compute instance's file system. See Connecting to a Volume.
    You can copy the required commands from the iSCSI Commands and Information dialog.
  13. From the Oracle Cloud Infrastructure Console, click Reboot to reboot the compute instance.
    The WebLogic Server processes start automatically.
  14. Repeat all of these steps for each of the remaining compute instances in your domain.

After you restore the domain, verify that you can access the WebLogic Server administration console and your applications. See:

Recover from an Operating System Failure

If you encounter an Operating System (OS) failure, you have different options to recover your domain.

To recover your domain, complete the following:

  1. Repair the boot volume. See Repair a Boot Volume.
    Did this recover your domain?
    • Yes: Skip the next steps.
    • No: Go to next step.
  2. Move the WebLogic Server instance. See Move a WebLogic Server Instance.
    Did this recover your domain?
    • Yes: Skip the next step.
    • No: Go to next step.
  3. If step 1 or step 2 does not recover your domain, then as a last option complete this step.

    Delete the instance and then create an instance from a boot volume backup. See Restoring a Boot Volume.

    Note:

    If you restore a boot volume:
    • All the stack metadata is lost. So, no post-provisioning actions, like restart script is available.
    • If there are no other stack instances in the same compartment, then the new instance will not inherit the UCM subscription pricing.

Repair a Boot Volume

If the boot volume for one of your Oracle WebLogic Server for OCI compute instances becomes corrupted and will not boot, you can attach it to another compute instance to troubleshoot and repair it.

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. Click the navigation menu Navigation Menu icon, select Compute. Under the Compute group, click Instances.
  3. Select the Compartment in which your domain was created.
  4. Click the compute instance that you need to repair.
  5. Identify the region and availability domain for the compute instance.
  6. If the compute instance is running, click Stop.
  7. Click Boot Volume.
  8. Click the Actions icon for the boot volume, and then select Detach.
  9. Identify a working Linux compute instance in the same region and availability domain, or create a new Linux compute instance.
  10. Access the new compute instance with SSH.
  11. Use the lsblk command to identify the devices and partitions that are currently configured on the compute instance.
    Example:
    sudo lsblk
    NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda      8:0    0 46.6G  0 disk
    ...
  12. Return to the Oracle Cloud Infrastructure Console.
  13. From the Instances page, click the new compute instance.
  14. Click Attached Block Volumes.
  15. Click Attach Block Volume.
  16. For Block Volume, select the boot volume that you need to repair.
  17. Click Attach.
  18. Return to the SSH session.
  19. Run the lsblk command again, and identify the new device and partitions.
    Example:
    sudo lsblk
    NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sdb      8:16   0 46.6G  0 disk
    ¿¿sdb2   8:18   0    8G  0 part
    ¿¿sdb3   8:19   0 38.4G  0 part
    ¿¿sdb1   8:17   0  200M  0 part
    sda      8:0    0 46.6G  0 disk
    ...
  20. Use the fsck command to perform a consistency check of each partition on the new device.
    sudo fsck -V /dev/<partition>

    Example:

    sudo fsck -V /dev/sdb1
    sudo fsck -V /dev/sdb2
    sudo fsck -V /dev/sdb3
    
  21. When prompted, correct any errors found in the partitions.
  22. Return to the Oracle Cloud Infrastructure Console.
  23. Detach the repaired boot volume from the compute instance's block volumes. See Detaching a Volume.
    If the volume attachment type is iSCSI, then connect to the compute instance with SSH, and follow the instructions in the Detach Block Volume dialog.
  24. Navigate to the original compute instance.
  25. Attach the repaired boot volume to original compute instance. See Attaching a Volume.
  26. Click Start to start the compute instance.