Back Up and Restore a Domain
Oracle WebLogic Server for OKE provides the ability to backup and restore your domain.
Back up a domain:
- By default, every time you run a job, a back up of the domain is created automatically.
- There is no job available to periodically back up your domain.
- You can also manually take a backup by copying the current
yaml
file to your preferred location. Ayaml
file has information about the current setup of the domain.
The backups are location at: /u01/shared/weblogic-domains/<domain_name>/backups
A sample backup:
[opc@oracle-admin oracledomain]$ pwd
/u01/shared/weblogic-domains/oracledomain
[opc@oracle-admin oracledomain]$ ll -tR
.:
total 25
-rwxr-xr-x. 1 opc opc 3728 Sep 24 16:14 domain.yaml
drwxr-xr-x. 3 opc opc 1 Sep 24 16:14 backups
-rw-rw-r--. 1 opc opc 4642 Sep 23 17:16 provisioning_metadata.json
-rw-rw-r--. 1 opc opc 1495 Sep 23 16:55 create-domain-inputs.yaml
./backups:
total 1
drwxr-xr-x. 2 opc opc 2 Sep 24 16:14 20-09-24_15-57-44
./backups/20-09-24_15-57-44:
total 16
-rw-r--r--. 1 opc opc 3728 Sep 24 16:14 domain.yaml
-rw-r--r--. 1 opc opc 3725 Sep 24 16:14 prev-domain.yaml
Where:
prev-domain.yaml
, is the previous domain that was running before the current job was completed.domain.yaml
, is the existing domain after the current job was completed.
Restore a domain:
- Access the administration compute instance for your domain.
- Go to the backup location, where the domain
yaml
that you want to apply is located. - Open the domain
yaml
and make a note of the image id.For example:image: "phx.ocir.io/ax8cfrmecktw/oracle/oracle_domain/wls-domain-base:12.2.1.4.200714-200819-20-09-23_14-51-16"
- Run the following commands to set the required environment variables:
export wls_domain_namespace=<domain namespace> export wls_domain_uid=<domain UID> export ocir_url=<region>.ocir.io
- Run the following command:
/u01/shared/scripts/pipeline/common/pipeline_common.sh -i <image_id>
Where, <image_id> is the image id you noted in step 2.
For example:/u01/shared/scripts/pipeline/common/pipeline_common.sh -i phx.ocir.io/ax8cfrmecktw/oracle/oracle_domain/wls-domain-base:12.2.1.4.200714-200819-20-09-23_14-51-16