Using the Migration Tool
This repository contains a consolidated script migration_script.sh that automates the complete migration of an on-premise WebLogic domain to Oracle Cloud Infrastructure (OCI).
The script combines all required tasks into a single workflow:
- Install dependencies
- Discover WebLogic domain and infrastructure
- Discover datasources
- Generate OCI Resource Manager stack
- Upload stack to OCI Object Storage Bucket(Optional)
- Archive WebLogic domain
- Upload archives to OCI Object Storage Bucket(Optional)
Step 1. Declare WebLogic source domain details in $toolHome/config/on-prem.env
Example:
######################################################################
# ssh_user: An Operating System user with read and write permissions
# on WebLogic Domain, Oracle Middleware and Java Home.
# Example oracle
######################################################################
ssh_user=oracle
######################################################################
# CLEAR VALUE (leave blank) if ssh_password_file is set.
# ssh_private_key_file: The file name of a file that contains the user’s private key
# to use when authenticating with a public/private key pair.
# Example /home/oracle/.ssh/id_rsa
######################################################################
ssh_private_key_file=/home/oracle/.ssh/id_rsa
######################################################################
# CLEAR VALUE (leave blank) if ssh_private_key_file is not passphrase protected.
# ssh_private_key_pass_file: Path to file containing passphrase for private key
# (required only if your private key is passphrase protected).
######################################################################
ssh_private_key_pass_file=
######################################################################
# CLEAR VALUE (leave blank) if ssh_private_key_file is set.
# ssh_password_file: The file name of a file that contains the password string for the
# user’s password to use when authenticating with user name and password.
######################################################################
ssh_password_file=
######################################################################
# domain_home: Weblogic Domain's path. Domain to migrate to OCI.
# oracle_home: Home directory of the Oracle WebLogic installation.
# Set to ORACLE_HOME in local Linux Server.
# java_home : The location of the JDK that WebLogic Server uses for execution
and was used during its installation.
######################################################################
domain_home=/u01/data/domains/test_domain
oracle_home=/u01/app/oracle/middleware
java_home=/u01/jdk
######################################################################
# skip_transfer: Defaults to false.
# - false: Archives will be transferred to OCI Object Storage.
# bucket_name, compartment_ocid, and tenancy_namespace must be set.
# - true : Archive transfer is skipped. The below OCI storage parameters are not required.
######################################################################
skip_transfer=false
######################################################################
# The following values are required ONLY if skip_transfer=false
# bucket_name: Name of the OCI Object Storage Bucket where archives will be uploaded.
# compartment_ocid: The compartment where the OCI Object Storage bucket exists(in case bucket
# is pre-existing) or to be created(in case bucket is not pre-existing).
# tenancy_namespace: Namespace of the tenancy.
######################################################################
bucket_name=test_bucket
compartment_ocid=ocid1.compartment_tenancy_namespace=<name> Step 2. Pre-requisite Steps for executing the Migration Script
Before executing the migration script migration_script.sh, ensure the following pre-requisites are completed:
-
Access to GitHub The WebLogic Migration Tool requires access to GitHub to download required libraries (WebLogic Deployment Tool) to discover the source WebLogic environment.
Note:
Alternatively, specific releases can be manually downloaded and placed in$toolHome/deps/wdt -
All Source domain Servers Must Be Up and Running (Required) In the source environment, all WebLogic Server hosts (AdminServer and Managed Servers) are expected to be up and running. This is mandatory to ensure the migration script can successfully connect, discover, and archive domain configurations.
-
Manual Archive Transfer If you plan to perform step 5 (upload stack) and step 7 (upload archives) manually, set
skip_transfer=trueinon-prem.env. Transfer the archives manually by following the instructions in$toolHome/logs/migration_script.log. The archives are available inside$toolHome/outon the AdminServer host, provided the AdminServer host has enough space to accommodate the archives from all the hosts. -
OCI-CLI Installation (Optional)
- If you want the script to handle uploads automatically, install the OCI-CLI on the AdminServer host.
- Installation and configuration details: OCI CLI Documentation Installation Steps:
# Enable the Oracle Linux Developer repository sudo dnf -y install oraclelinux-developer-release-el8 # Install OCI CLI package sudo dnf install python36-oci-cli # Upgrade pip and required dependencies pip3 install --user --upgrade pip pip3 install --user six==1.15.0 --upgrade pip3 install --user click==8.0.4 pip3 install --user oci==2.157.0 --upgrade- To verify installation, run:
IAM Policy Requirement: The user running this command must belong to a group with the following policy at the tenancy level:oci iam region listAllow group <YourGroupName> to inspect regions in tenancy - Required User Policies for Non-Admin Users (if automatic upload is needed):
- Allow group
Non-Adminto manage object-family in the compartment specified inon-prem.envfor storage bucket details. - Allow group
Non-Adminto read buckets in the tenancy.
- Allow group
-
SSH Authentication The AdminServer host of the source domain must have passwordless SSH authentication established to all WebLogic Managed Server Linux hosts and to itself. This ensures seamless remote operations during migration.
Example: On the AdminServer host, verify SSH connectivity to itself and to each Managed Server host without a password prompt.
# Get the full hostname of the AdminServer hostname -f # Test SSH connection to the AdminServer itself [oracle@hostname-wls-0 ~]$ ssh <hostname> [oracle@hostname-wls-0 ~]$ exit # Test SSH connection to each Managed Server host [oracle@hostname-wls-0 ~]$ ssh <hostname> [oracle@hostname-wls-1 ~]$ exitRepeat this process from the AdminServer host to all hosts in the WebLogic domain to confirm passwordless SSH access is properly configured.
Step 3. Run the migration script from the $toolHome/bin directory.
$ bash migration_script.shThe script is idempotent: If a step has already completed successfully in a previous run, it will be skipped automatically.