Replace Domain and Binaries

Replace the domain and binaries in the Oracle WebLogic Server for OCI instance.

Complete the following steps:
  1. Access the VM running the WebLogic administration server in the Oracle Java Cloud Service instance and run the following commands to preserve the WebLogic domain and binaries:
    sudo su - oracle
    cd /u01/data/domains
    tar cvf /tmp/domain.tar .
    cd /u01/app/
    tar cvf /tmp/mw.tar .
    cd /u01/jdk/
    tar cvf /tmp/jdk.tar .
  2. Log in as an oracle user and ssh to each additional VM in the Oracle Java Cloud Service instance, and preserve the WebLogic domain contents.

    You do not have to save the binaries from each VM, as the binaries are the same on each VM.

    cd /u01/data/domains
    tar cvf /tmp/domain.tar .
  3. Set up a ssh access from the Oracle Java Cloud Service instance to the Oracle WebLogic Server for OCI instance:
    1. On the source instance generate a public key from the private key that is in the oracle user's home:
      # Must be run as oracle user. If you are the opc user, run 'sudo su - oracle' first.
      ssh-keygen -y -f ~/.ssh/id_rsa
    2. Save the output.
    3. Access the Oracle WebLogic Server for OCI instance as the opc user.
    4. On each VM in the Oracle WebLogic Server for OCI instance append the output to the authorized_keys for the oracle user:
      sudo su - oracle
      vi ~/.ssh/authorized_keys
      # add the public key to this file.
    5. On each VM in the Oracle WebLogic Server for OCI instance run the following command to move the contents out of the current domain, middleware home, and JDK home:
      sudo su - oracle
      mkdir /tmp/domain_bak
      mv /u01/data/domains/* /tmp/domain_bak/
      mkdir /tmp/mw_bak
      mv /u01/app/* /tmp/mw_bak/
  4. Copy the domain.tar, mw.tar, and jdk.tar files to the Oracle WebLogic Server for OCI instance:
    1. Access the Oracle Java Cloud Service instance as the opc user and run scp to copy the tar files from each VM to the corresponding VM on the Oracle WebLogic Server for OCI instance.
      In the following example there is a single VM on the Oracle WebLogic Server for OCI instance with an IP address 10.1.1.1:
      sudo su - oracle
      scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/domain.tar 10.1.1.1:/tmp/
      scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mw.tar 10.1.1.1:/tmp/
      scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/jdk.tar 10.1.1.1:/tmp/
    2. Ssh to the Oracle WebLogic Server for OCI instance as the opc user and on each VM run the following to untar the source instance domain:
      sudo su - oracle
      tar xvf /tmp/domain.tar -C /u01/data/domains/
      tar xvf /tmp/mw.tar -C /u01/app/
      mkdir /u01/app/oracle/jdk
      tar xvf /tmp/jdk.tar -C /u01/app/oracle/jdk/

Note:

Oracle WebLogic Server for OCI creates only a data and block volume. If you created additional volumes for your Oracle Java Cloud Service instance, then add a new volume and transfer the data using the above steps in this topic.