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:

  1. Install dependencies
  2. Discover WebLogic domain and infrastructure
  3. Discover datasources
  4. Generate OCI Resource Manager stack
  5. Upload stack to OCI Object Storage Bucket(Optional)
  6. Archive WebLogic domain
  7. 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:

  1. 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
  2. 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.

  3. Manual Archive Transfer If you plan to perform step 5 (upload stack) and step 7 (upload archives) manually, set skip_transfer=true in on-prem.env. Transfer the archives manually by following the instructions in $toolHome/logs/migration_script.log. The archives are available inside $toolHome/out on the AdminServer host, provided the AdminServer host has enough space to accommodate the archives from all the hosts.

  4. 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:
      oci iam region list
      IAM Policy Requirement: The user running this command must belong to a group with the following policy at the tenancy level:
      Allow group <YourGroupName> to inspect regions in tenancy 
    • Required User Policies for Non-Admin Users (if automatic upload is needed):
      1. Allow group Non-Admin to manage object-family in the compartment specified in on-prem.env for storage bucket details.
      2. Allow group Non-Admin to read buckets in the tenancy.
  5. 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 ~]$ exit

    Repeat 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.sh

The script is idempotent: If a step has already completed successfully in a previous run, it will be skipped automatically.